Effacer les filtres
Effacer les filtres

How to plot the graphs by fixing constants of your choice

2 vues (au cours des 30 derniers jours)
Ibrahim Bin Umair
Ibrahim Bin Umair le 24 Mai 2021
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

Réponse acceptée

DGM
DGM le 24 Mai 2021
Modifié(e) : DGM le 24 Mai 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

Plus de réponses (1)

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

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by