Undefined function 'cos' for input arguments of type 'tf'.

1 回表示 (過去 30 日間)
Tina Barsoumian
Tina Barsoumian 2020 年 2 月 20 日
編集済み: Adam Danz 2020 年 2 月 20 日
I am trying to calculate the laplace transform of the equation below (theta1) but it doesn't seem to recognize neither the cos or cosd function. Here is my code:
theta1=((3/8)*pi)+((1/8)*pi*cos(((pi/.3)*s)+(pi/16)));
thata1s=laplace(theta1);
  1 件のコメント
Adam Danz
Adam Danz 2020 年 2 月 20 日
編集済み: Adam Danz 2020 年 2 月 20 日
Check out the documentation describing the first input to that function
Spolier alert: the input is expected to be symbolic, not double (where did you get the "TF" from in the title of your question? - I just realized you're working with a transfer function)
Here are two tutorials on this function

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

回答 (2 件)

madhan ravi
madhan ravi 2020 年 2 月 20 日
編集済み: madhan ravi 2020 年 2 月 20 日
syms s % forgot to add this part
theta1=((3/8)*pi)+((1/8)*pi*cos(((pi/.3)*s)+(pi/16)));
theta1s=laplace(theta1);

Walter Roberson
Walter Roberson 2020 年 2 月 20 日
An s or z generated by tf('s') or tf('z') is not a symbolic variable but laplace() and ilaplace() can only be used with Symbolic expressions.
If you look in the File Exchange searching for tf2sym then as part of two of the contributions there are functions that can convert tf representation to symbolic representation. sym2tf on the same contributions can convert some symbolic expressions to tf notation.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by