Looking to plot a known, single value variable, against another, single value variable, for a range of figures

16 ビュー (過去 30 日間)
Afrdev
Afrdev 2015 年 10 月 29 日
回答済み: Jon 2015 年 10 月 29 日
Hi all,
I'm looking to plot two variables. y, on the x axis, and R1, on the Y.
Using matlab, I have determined a fixed value for y, and one for R1. However, the task is to plot the relationship between the two, for varying values of y.
They are linked by the equation;
R1 = (m*(L*7.22)*(f*cosd(y)))+((m*7.22)*(f*sind(y)));
Despite research, I'm at a bit of a loss. Any help would be invaluable. Apologies for sloppy code, i'm new here :)
Thanks!

回答 (1 件)

Jon
Jon 2015 年 10 月 29 日
y = 0:1:100; % can change this range to whatever you want; the middle number is the interval
R1 = (m*(L*7.22)*(f*cosd(y)))+((m*7.22)*(f*sind(y)));
plot(y,R1)
Note that since you're not multplying or dividing or powering any of the "y" terms with each other, you can get away without using the . in front of the operators (e.g. .*, ./, .^).

カテゴリ

Help Center および File ExchangeGraphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by