フィルターのクリア

I would add one variable inside function

1 回表示 (過去 30 日間)
Willim
Willim 2019 年 3 月 10 日
コメント済み: Willim 2019 年 3 月 11 日
I have x(t) and I would to create x(t+ta) by matlab code. For example
if I have x(t)= 2t+3 , I need to create x(t+ta)= 2t+2ta+3 and so on.
Please consider x(t)=5sin(2t+theta), and x(t+ta)=5sin(2t+2ta+theta) for your explaintion.
Thank you in advance.

採用された回答

madhan ravi
madhan ravi 2019 年 3 月 10 日
編集済み: madhan ravi 2019 年 3 月 10 日
Read about subs() :
syms a t theta
x(t)=5*sin(2*t+theta);
subs(x(t)*x(t+a),{t,a,theta},{1,2,3}) % t with value one ,a with 2 and theta 3 are example values
  5 件のコメント
madhan ravi
madhan ravi 2019 年 3 月 11 日
double(subs(answer,ta,1:10))
Willim
Willim 2019 年 3 月 11 日
I think double(a) works to solve this problem

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

その他の回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 3 月 10 日
編集済み: madhan ravi 2019 年 3 月 10 日
syms t ta theta
x(t)=5*sin(2*t+theta);
disp(x(t+ta))
Command Window
5*sin(2*t + 2*ta + theta)
  2 件のコメント
Willim
Willim 2019 年 3 月 10 日
Thank you but the result on disp cannot use to multiply with x(t). it gives
x(t)*disp(x(t+ta))
Error using sym/disp
Too many output arguments.
I need to have the result x(t)*x(t+ta).
after finding the x(t)*x(t+ta) which should be
25*sin(2*t + theta)*sin(2*t + 2*ta + theta)
How can I substitute t , theta , and ta values in
25*sin(2*t + theta)*sin(2*t + 2*ta + theta)
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 3 月 10 日
編集済み: KALYAN ACHARJYA 2019 年 3 月 10 日
Hello Faraj, you are doing wrong way, do the operation inside disp() only
Its giving the answer:
syms t ta theta
x(t)=5*sin(2*t+theta);
disp(x(t)*x(t+ta))
tttt.png

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

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by