plot an obtained function after several calculus

조회 수: 14 (최근 30일)
L.GREEN
L.GREEN 2024년 8월 4일
편집: Torsten 2024년 8월 4일
Good morning!
I want to plot the folloing function which is obtained after several calculus on Matlab,
syms s t a
Y=(sin(int(cos((sin(int(cos((0.00008414709848078965066525023216303*cos(s^(2/3))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/3)))^2)^2, s, 0, 1))/100 + sin(0.00008414709848078965066525023216303*cos(s^(1/9))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/18)))^2/100)^2*(exp(-2*s^(1/3)) + cos(int(sin(0.00008414709848078965066525023216303*cos(a)^2 + 0.008414709848078965066525023216303*exp(-2*a^(1/2))) + 1, a, 0, s^(2/3)))^2/100 + sin(0.00008414709848078965066525023216303*cos(s^(1/3))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/6)))^2/100)^2)^2, s, 0, 1))/100 + sin((sin(int(cos((0.00008414709848078965066525023216303*cos(s^(2/3))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/3)))^2)^2, s, 0, 1))/100 + sin(0.00008414709848078965066525023216303*cos(t^(1/18))^2 + 0.008414709848078965066525023216303*exp(-2*t^(1/36)))^2/100)*(exp(-2*t^(1/6)) + cos(int(sin(0.00008414709848078965066525023216303*cos(s)^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/2))) + 1, s, 0, t^(1/3)))^2/100 + sin(0.00008414709848078965066525023216303*cos(t^(1/6))^2 + 0.008414709848078965066525023216303*exp(-2*t^(1/12)))^2/100))^2/100)*(exp(-2*t) + cos(int(sin((sin(int(cos((0.00008414709848078965066525023216303*cos(s^(2/3))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/3)))^2)^2, s, 0, 1))/100 + sin(0.00008414709848078965066525023216303*cos(s^(1/6))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/12)))^2/100)*(exp(-2*s^(1/2)) + sin(0.00008414709848078965066525023216303*cos(s^(1/2))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/4)))^2/100 + cos(int(sin(0.00008414709848078965066525023216303*cos(a)^2 + 0.008414709848078965066525023216303*exp(-2*a^(1/2))) + 1, a, 0, s))^2/100)) + 1, s, 0, t^2))^2/100 + sin((sin(int(cos((0.00008414709848078965066525023216303*cos(s^(2/3))^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/3)))^2)^2, s, 0, 1))/100 + sin(0.00008414709848078965066525023216303*cos(t^(1/6))^2 + 0.008414709848078965066525023216303*exp(-2*t^(1/12)))^2/100)*(exp(-2*t^(1/2)) + cos(int(sin(0.00008414709848078965066525023216303*cos(s)^2 + 0.008414709848078965066525023216303*exp(-2*s^(1/2))) + 1, s, 0, t))^2/100 + sin(0.00008414709848078965066525023216303*cos(t^(1/2))^2 + 0.008414709848078965066525023216303*exp(-2*t^(1/4)))^2/100))^2/100)
Unrecognized function or variable 'a'.
in this function another variable appeared (denoted by ' a' ) so i add it in symbolique variable
To plot this function i used the folowing code:
t_vals=linspace(0, 1, 10);
figure(1)
hold on
y_eval = double(eval(subs(Y(i+1),t, t_vals)))
plot(t_vals, y_eval;
hold off
  댓글 수: 6
L.GREEN
L.GREEN 2024년 8월 4일
Ok, that you for your help.
Walter Roberson
Walter Roberson 2024년 8월 4일
y_eval = double(eval(subs(Y(i+1),t, t_vals)))
You should never eval() a symbolic result. eval() of a symbolic result has no documented meaning.
In practice, eval() of a symbolic result is the same as eval() of char() of the symbolic result. The problem with that is that char() of symbolic results produces something that is not in MATLAB expression format and is not in MuPAD internal code: char() of symbolic results is intended to be human readable, and is not intended for machine processing.
What you need to do instead is perform all necessary subs() on the expression, and then double() the result without using eval()

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by