Borrar filtros
Borrar filtros

How would I go about plotting an equation?

1 visualización (últimos 30 días)
Raul
Raul el 15 de Mzo. de 2012
I need to plot the following equation: (y/34) + (x/84) = 1; with 'y' and 'x' being numbers from 0-100. I know how to define x and y(i.e. x = (0:100) and likewise with 'y'), but when I try plotting the equation I just get a blank graph, can anyone guide me in the right direction, please?

Respuestas (2)

Geoff
Geoff el 16 de Mzo. de 2012
You are incorrect in your assumption that you define 'y' in the same manner as 'x'. To 'plot the equation' you first have to rearrange for y in terms of x, then plug your vector for x into that, and finally plot.
x = 0:100;
y = % you work it out
plot(x,y);

Rick Rosson
Rick Rosson el 15 de Mzo. de 2012
Please post your code.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by