3D Plotting Help Linear Eq. w/ Changing Var in Z

3 ビュー (過去 30 日間)
William van Es
William van Es 2017 年 10 月 12 日
コメント済み: William van Es 2017 年 10 月 13 日
Dear people,
Right here I have a 2D graph of a very simple linear equation. After experimenting for hours with surf/plot3 I would love to get some help with the following goal.
2D graph: VAR1 = 5:.1:15;
C1 = 5; VAR2 = 0.4; g = 1/9.80665;
R = VAR2*VAR1*g*200*.85*3.6;
f1 = (((R*1000)/C1)/(3600));
plot(f1,R) grid on; pbaspect([1 2 3]) ylim([100 450]); xlim([0 15]); xticks([0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15])
My goal is to plot this linear eq. a multiple times in a third axis, with variables changing. I would like to have C1 change from 5 to 25 and VAR2 from 0.15 to 0.85 at the same time. So every time the linear equation with a different value for C1 and VAR2 is plotted behind the other, I expect to see a twisted and shifted plane.
How to do this? My experience with 3D graphs is too small to wrap my head around the syntaxes and logic in order to code this. I tried to make a vector e.g. 0.15:0.007:0.85 and plug it in everywhere using plot3(x,y,z) but nothing works. It turns out to be a set of lines going in the third direction, opposed to what I would like to see, a set of linear equations shifting and changing slope after each other in a third axis.
like this: VAR1 = 5:.1:15; VAR2 = transpose(0.15:0.007:0.85); g = 1/9.80665; C1 = 5;
R = VAR2*VAR1*g*200*.85*3.6; f1 = (((R*1000)/C1)/(3600)); plot3(f1,VAR2,R) grid on;
Hopefully somebody could help me out in any way here!

回答 (1 件)

Matthew Nargol
Matthew Nargol 2017 年 10 月 12 日
Try running it in a loop and using 'hold on' so the plots all come out in one figure.
i.e. for z=1:20
figure
hold on
plot3(x,y,z)
end
  1 件のコメント
William van Es
William van Es 2017 年 10 月 13 日
Thanks for your reply! I don't know how to combine the for loop function in such a way it plots a linear eq. in the 3th dimension..

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by