plotting 3-D data in 2-D
4 次查看(过去 30 天)
显示 更早的评论
Hi again,
I have a 3D matrix (test=rand(3,3,4)) and I'm trying to plot each 2D entry through the third dimension [i.e. plot nine lines: (1,1,:),(1,2,:) and so on]. I'm not exactly sure how to do this, and can't get it to work with plot or plot3.
Any ideas?
Thanks,
Don
0 个评论
采纳的回答
Sean de Wolski
2011-6-15
test = repmat(magic(3),[1 1 4]); %each vector into the third dimension will be the same (so we can verify accuracy)
test2 = reshape(permute(test,[3 2 1]),size(test,3),[]); %permute it and reshape it so that each column represents one vector into the third dimension
plot(test2) %plot it
5 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!