フィルターのクリア

how to calculate functions

42 ビュー (過去 30 日間)
sumaiya hossain
sumaiya hossain 2022 年 8 月 2 日
回答済み: Steven Lord 2022 年 8 月 2 日
syms t
t = -3:0.1:10;
y = 4*sin(2*pi*t) + exp(-t)/t;
tlim = ([-1 10]);
Out = subs(y);
vpa_Out =vpa(Out);
plot(t,y)
  2 件のコメント
sumaiya hossain
sumaiya hossain 2022 年 8 月 2 日
The code keeps on saying 'syms' requires Symbolic Math Toolbox.
Error in func_t (line 2)
syms t
Just to clarify this is how you code for the function to be calculated?
Torsten
Torsten 2022 年 8 月 2 日
The code keeps on saying 'syms' requires Symbolic Math Toolbox.
And do you have the license ?
What do you get when you enter
[status,errmsg] = license('checkout','Symbolic_Math_Toolbox')

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

回答 (1 件)

Steven Lord
Steven Lord 2022 年 8 月 2 日
You don't need the line of code where you define t as a symbolic variable, since on the next line you throw that symbolic variable away and assign a numeric vector to that identifier.
t = -3:0.1:10;
I believe you will need to make one change to your function. You need to use element-wise division (./) instead of matrix division (/) in the second term if you want to divide each element of exp(-t) by the corresponding element of t.
y = 4*sin(2*pi*t) + exp(-t)./t;
plot(t,y)
Note that your function is undefined at t = 0.

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by