필터 지우기
필터 지우기

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 CenterFile Exchange에서 2-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