how to use pcshow to plot a graph made of the same variable point?
Show older comments
Hi! I have to plot a 3D graph using pcshow function where all the points come from the same point P made of three variable coordinates. So X Y Z are the three coordinates depending on 6 variables each. I wrote a code, but I'm just able to find all the possible values of P and plotting just the last of them, while I need to plot them all in the same graph to make something that should look like a sphere. I think that I should just need to understand or how to store all the possible P values (over 4 billion in my computation), or how to put in the graph the actual P values and then next and so on. I'll add my code here. Thank you very much!
for t1=0:10:380
for t2=0:10:360
for t3=0:10:570
for t4=0:10:380
for t5=0:10:360
for t6=0:10:380
X=95*sind(t1) + 540*cosd(t1)*cosd(t2) + 150*cosd(t4)*sind(t1) + 160*sind(t5)*(sind(t1)*sind(t4) - cosd(t4)*(cosd(t1)*sind(t2)*sind(t3) + cosd(t1)*cosd(t2)*cosd(t3))) + 160*cosd(t5)*(cosd(t1)*cosd(t2)*sind(t3) - cosd(t1)*cosd(t3)*sind(t2)) + 150*sind(t4)*(cosd(t1)*sind(t2)*sind(t3) + cosd(t1)*cosd(t2)*cosd(t3)) + 540*cosd(t1)*cosd(t2)*sind(t3) - 540*cosd(t1)*cosd(t3)*sind(t2);
Y=540*cosd(t2)*sind(t1) - 150*cosd(t1)*cosd(t4) - 95*cosd(t1) - 160*sind(t5)*(cosd(t1)*sind(t4) + cosd(t4)*(sind(t1)*sind(t2)*sind(t3) + cosd(t2)*cosd(t3)*sind(t1))) + 160*cosd(t5)*(cosd(t2)*sind(t1)*sind(t3) - cosd(t3)*sind(t1)*sind(t2)) + 150*sind(t4)*(sind(t1)*sind(t2)*sind(t3) + cosd(t2)*cosd(t3)*sind(t1)) + 540*cosd(t2)*sind(t1)*sind(t3) - 540*cosd(t3)*sind(t1)*sind(t2);
Z=540*sind(t2) + 540*cosd(t2)*cosd(t3) + 540*sind(t2)*sind(t3) + 160*cosd(t5)*(cosd(t2)*cosd(t3) + sind(t2)*sind(t3)) - 150*sind(t4)*(cosd(t2)*sind(t3) - cosd(t3)*sind(t2)) + 160*cosd(t4)*sind(t5)*(cosd(t2)*sind(t3) - cosd(t3)*sind(t2)) + 245;
P=[X Y Z];
pcshow(P)
end
end
end
end
end
end
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!