3D plot of multiple columns of 2D data

Hi,
I'm wondering if someone can point me in the right direction. I have 16columns of data which use a common x-axis, making a 355x17 array. I can use stem3 to plot one of the columns, when i use the data cursor on the plot i see that x=1,y=my common x-axis designator, z=my data value from the array, this is all fine. what I would like to know is how i can offset the x value for the x,y,z so I can see all 16 rows in one 3D space.
The 'common x=axis' is just the numbered measurement, 1-355, the data columns lay anywhere between 0-10.
figure
x=noz %my common x-axis or measurement number 1-355
y1=VelMASTERarray(:,2) %a column from my master array
y2=VelMASTERarray(:,3)
y3=VelMASTERarray(:,4)
y4=VelMASTERarray(:,5)
stem3(y1)
% hold on
% stem3(z+10,y2)
% stem3(x+1,y2)
None of the commented out attempts worked.
Any ideas if it is possible?
Best regards
Steve

 Risposta accettata

KSSV
KSSV il 14 Giu 2017
Modificato: KSSV il 14 Giu 2017
A = rand(355,17) ;
x = 1:size(A,1) ;
figure
hold on
for i = 1:size(A,2)
% plot3(x,i*ones(size(x)),A(:,i))
stem3(x,i*ones(size(x)),A(:,i))
end
view(3)

1 Commento

Hi KSSV, I did not realise my colleague was logged in on my work PC so it was me who raised the question and I will ask him to accept this as it is perfect. I don't know what the
i*ones(size(x))
line means (just that it works). I will now try to label the rows of data.
Thank you KSSV
Steve

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by