graphing x as a function of y, y as a function of x in one plot

3 visualizaciones (últimos 30 días)
aubelee
aubelee el 13 de Abr. de 2021
Editada: Cris LaPierre el 13 de Abr. de 2021
Hello,
I am seriously new to any kind of programming, so apologies in advance.
I am trying to graph two functions (nullx, nully) where null x is a function of y and null y is a funciton of x.
The graph should be on a typical x-y plane, but I am not getting any plots out of my code. I appreciate any help, and please explain specifically. Thank you!
a = 0.2;
%nullx= -(y-a-a*y)/(-a-a*y);
nully= -(x-a-a*x)/(-a-a*x);
for y = 1:10
nullx= -(y-a-a*y)/(-a-a*y);
plot(0:10,nullx);
end

Respuestas (1)

Cris LaPierre
Cris LaPierre el 13 de Abr. de 2021
Editada: Cris LaPierre el 13 de Abr. de 2021
You would benefit by going through MATLAB Onramp.
  • Ch 3 covers creating vectors and matrices
  • Ch 6 covers array calculations (eliminating the need to use a for loop)
  • Ch 9 covers plotting
  • Ch 13 covers for loops, and more importantly, capturing the result from each loop

Categorías

Más información sobre MATLAB 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