How to sum functions and get an expression in order to a given variable?

1 回表示 (過去 30 日間)
DDD
DDD 2015 年 3 月 5 日
編集済み: per isakson 2015 年 3 月 13 日
For example, if a have:
x=@(t) 1+ t + 3t^2 + 5t^3 + 9t^4;
y=@(t) 1+ t + 3t^2
z=@(t) x(t)-y(t)
can i get an answer like:
x(t)-y(t)= 5t^3 + 9t^4

採用された回答

John D'Errico
John D'Errico 2015 年 3 月 5 日
編集済み: John D'Errico 2015 年 3 月 5 日
Why would you think it possible or not? Did you try it?
x=@(t) 1+ t + 3*t^2 + 5*t^3 + 9*t^4;
y=@(t) 1+ t + 3*t^2;
z=@(t) x(t)-y(t)
syms t
z(t)
ans =
9*t^4 + 5*t^3
If your question is can you actually get something like this:
x(t)-y(t) = 5t^3 + 9t^4
I'm not really sure what you mean by that, or what is your goal.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by