How to plot a graph with 3 different length vectors, vectors are generated by rand() function.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Vikas Rahar
am 4 Nov. 2019
Beantwortet: JESUS DAVID ARIZA ROYETH
am 4 Nov. 2019
I am plotting in 3 dimenions for 20000 points in the interval (0,1).
x=0:0.2:1
y=0:0.2:1
z=0:0.1:1
x= rand(1,20000)
y= rand(1,20000)
z=rand(1,20000)
i am extracting points foe which at least one of 3 dimensions is bigger than 0.9 and plotting the points.
plot3(x(find(x>0.9)),y(find(y>0.9)),z(find(z>0.9)),'b*');
As the size of x,y,z is not equal after the conditions. (Size would vary each time as i am using rand function)
I am getting error Vectors must be of the same length.
0 Kommentare
Akzeptierte Antwort
JESUS DAVID ARIZA ROYETH
am 4 Nov. 2019
solution:
close all
x= rand(1,20000);
y= rand(1,20000);
z=rand(1,20000);
f=or(or(x>0.9,y>0.9),z>0.9);
plot3(x(f),y(f),z(f),'b*')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Scatter Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!