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

조회 수: 11 (최근 30일)
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 CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by