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

8 visualizaciones (últimos 30 días)
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!

Respuestas (1)

Jon
Jon el 29 de Oct. de 2015
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. .*, ./, .^).

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by