Borrar filtros
Borrar filtros

How to plot the graphs by fixing constants of your choice

2 visualizaciones (últimos 30 días)
I have this expression as output
C1*exp(-x*(9/(4*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3) + 3/2)) + C2*exp(x*(9/(8*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3)/2 - 3/2))*cos((3^(1/2)*x*(9/(4*(37/8 - 10^(1/2))^(1/3)) - (37/8 - 10^(1/2))^(1/3)))/2) - C3*exp(x*(9/(8*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3)/2 - 3/2))*sin((3^(1/2)*x*(9/(4*(37/8 - 10^(1/2))^(1/3)) - (37/8 - 10^(1/2))^(1/3)))/2)
How can i plot the graph by fixing constants of my choice

Respuesta aceptada

DGM
DGM el 24 de Mayo de 2021
Editada: DGM el 24 de Mayo de 2021
C = [1 2 3] % pick some constants
x = linspace(0,50,100); % pick an interval
y = C(1)*exp(-x*(9/(4*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3) + 3/2)) ...
+ C(2)*exp(x*(9/(8*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3)/2 - 3/2)) ...
.*cos((3^(1/2)*x*(9/(4*(37/8 - 10^(1/2))^(1/3)) - (37/8 - 10^(1/2))^(1/3)))/2) ...
- C(3)*exp(x*(9/(8*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3)/2 - 3/2)) ...
.*sin((3^(1/2)*x*(9/(4*(37/8 - 10^(1/2))^(1/3)) - (37/8 - 10^(1/2))^(1/3)))/2);
plot(x,y)
or you could do the same thing using symbolic tools
syms x C1 C2 C3
y = C1*exp(-x*(9/(4*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3) + 3/2)) ...
+ C2*exp(x*(9/(8*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3)/2 - 3/2)) ...
*cos((3^(1/2)*x*(9/(4*(37/8 - 10^(1/2))^(1/3)) - (37/8 - 10^(1/2))^(1/3)))/2) ...
- C3*exp(x*(9/(8*(37/8 - 10^(1/2))^(1/3)) + (37/8 - 10^(1/2))^(1/3)/2 - 3/2)) ...
*sin((3^(1/2)*x*(9/(4*(37/8 - 10^(1/2))^(1/3)) - (37/8 - 10^(1/2))^(1/3)))/2);
y = subs(y,[C1 C2 C3],[1 2 3]); % specify the constants
fplot(y,[0 50]) % specify the interval

Más respuestas (1)

KSSV
KSSV el 24 de Mayo de 2021
You can substitute your value using subs. Read about this function.
Also you can plot for range values using fplot. Read about it.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by