how to plot a function?

1 visualización (últimos 30 días)
Kit Coltamne
Kit Coltamne el 30 de Nov. de 2017
Comentada: Star Strider el 30 de Nov. de 2017
Im trying to plot 'd' as a function of variable 'me' from 0 to 1200 but just get a straight line. Any suggestions? Thanks.
mc = 1000;
Sp = 4000;
Se = 400000;
Sc = 0.2;
eff = 0.6;
v = 13.41;
me = 0:1200;
d = ((Se*me*(Sp-(Sc*v)))/(Sc*Sp*(mc+me)))*eff;
plot(me,d,'x')

Respuesta aceptada

Star Strider
Star Strider el 30 de Nov. de 2017
You need to vectorise the division (use (./) instead of (/):
d = ((Se*me*(Sp-(Sc*v)))./(Sc*Sp*(mc+me)))*eff;
INSERT ‘.’ HERE
See Array vs. Matrix Operations (link) for details.
  2 comentarios
Kit Coltamne
Kit Coltamne el 30 de Nov. de 2017
Perfect, thank you !!
Star Strider
Star Strider el 30 de Nov. de 2017
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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