Borrar filtros
Borrar filtros

Help graphing this equation

1 visualización (últimos 30 días)
hans hans
hans hans el 18 de Abr. de 2018
Respondida: njj1 el 18 de Abr. de 2018
Hello, very new to MATLAB. I have managed to formulate the equation below, but have no idea how to graph it. Any help is much appreciated.
% let us assume values of variables
M=1;
N=2;
E=3;
t=1;
sigma=2;
n=2;
ans=M*sigma*(1/E+t/n)+N*sigma*(1-exp(-E*t/n))

Respuesta aceptada

njj1
njj1 el 18 de Abr. de 2018

You need to have an independent variable (e.g., when plotting y vs. x, x is the independent variable). So if you want to plot epsilon against some other variable, that other variable needs to change. Here's some code that might do what you want.

M=1;
N=2;
E=3;
sigma=2;
n=2;
t = 0:0.01:10; %this means have the variable t start at 0 and move in increments of 0.01 until it reaches 10
epsilon = M*sigma.*(1/E + t/n) + N*sigma.*(1-exp(-E.*t/n)); %the meaning of ".*" is that we multiply against each element of the vector t
plot(t,epsilon)

Good luck!

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots 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