how do I store a function into a variable and solve it?

I am trying to calculate this function: 𝑓(𝑡) = 4(sin(2𝜋𝑡)) + exp(𝑡)/𝑡
but it keeps on telling me 'Error using sym/assume Too many output arguments.'
syms t
y = 4*sin(2*pi*t) + exp(-t)./t;
eqn = y == 0
eqn = 
solv= solve(eqn,t)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
solv = 
98.5

4 件のコメント

Star Strider
Star Strider 2022 年 8 月 4 日
There are likely an infinity of solutions —
syms t
y = 4*sin(2*pi*t) + exp(-t)./t;
figure
fplot(y, [0 10])
grid
.
The range for the question was -3<t<10
so I did this:
but it still says Unable to solve symbolically, returing to numeric solution using vpasolve
in sym/solve line 304
In (line 7)
syms t
y = 4*sin(2*pi*t) + exp(-t)./t
y = 
eqn = y -- 0
eqn = 
figure
fplot(y,[-3 10])
grid
solv =solve(eqn,t)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
solv = 
98.5
Star Strider
Star Strider 2022 年 8 月 5 日
There remain an infinity of solutions!
sumaiya hossain
sumaiya hossain 2022 年 8 月 5 日
Hi thank you for your help, I used pasolve to gives such one value out of an infinite number of possible solutions

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

製品

リリース

R2022a

質問済み:

2022 年 8 月 4 日

コメント済み:

2022 年 8 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by