Why the software is not showing my plot ?
1 回表示 (過去 30 日間)
古いコメントを表示
The only problem is, my graph don't show nothing and i dont know why, i only want the normal graph of the parametric function
clc; close all;
e = 2,71828;
t = 10;
Q(t) = (4./697)*((e^-20*t./3)*(-63*cos(15*t)-116*sin(15*t) + 21*cos(10*t) + 16*sin(10*t)));
plot (t,Q(t));
0 件のコメント
採用された回答
Walter Roberson
2021 年 7 月 19 日
t = 10;
You define t as a specific scalar value
Q(t) = (4./697)*((e^-20*t./3)*(-63*cos(15*t)-116*sin(15*t) + 21*cos(10*t) + 16*sin(10*t)));
Because t is a specific scalar value, the right hand side of that calculates a scalar result. The left side is vector indexing, so the scalar result is stored at the 10th location in Q. If t had not happened to be an integer you would have had an error in storing the data
plot (t,Q(t));
t is a specific scalar, and you recall back the scalar calculated value from the previous line. So you are asking to plot with one scalar x value and one scalar y value. By default plot() does not create markers, and it only creates lines if there are at least two adjacent finite values to be plotted.
2 件のコメント
Walter Roberson
2021 年 7 月 19 日
Adjusted code:
Q = @(t) (4./697).*((exp(-20)*t./3).*(-63*cos(15*t)-116*sin(15*t) + 21*cos(10*t) + 16*sin(10*t)));
t = linspace(0,10,200);
plot(t, Q(t))
Please remember that e^-20*t./3 means to take e to the -20th power, and multiply the result by t and divide that result by 3. It does not mean to take e to a power calculated as (-20*t/3) .
Q = @(t) (4./697).*((exp(-20*t./3)).*(-63*cos(15*t)-116*sin(15*t) + 21*cos(10*t) + 16*sin(10*t)));
t = linspace(0,2,200);
plot(t, Q(t))
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!