How to plot the graphs by fixing constants of your choice

2 ビュー (過去 30 日間)
Ibrahim Bin Umair
Ibrahim Bin Umair 2021 年 5 月 24 日
コメント済み: Ibrahim Bin Umair 2021 年 5 月 24 日
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

採用された回答

DGM
DGM 2021 年 5 月 24 日
編集済み: DGM 2021 年 5 月 24 日
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

その他の回答 (1 件)

KSSV
KSSV 2021 年 5 月 24 日
You can substitute your value using subs. Read about this function.
Also you can plot for range values using fplot. Read about it.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by