Why the software is not showing my plot ?

1 回表示 (過去 30 日間)
Ian Samuelsson
Ian Samuelsson 2021 年 7 月 19 日
コメント済み: Ian Samuelsson 2021 年 7 月 19 日
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));

採用された回答

Walter Roberson
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
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))
Ian Samuelsson
Ian Samuelsson 2021 年 7 月 19 日
Soo the problem is not only in the ploting, but in my conception of e^(n).
i get it , i will try exercise this kind of problems, TY soo mutchh !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by