Computing Equation values for its unknown variables

1 回表示 (過去 30 日間)
aliza mustafa
aliza mustafa 2022 年 9 月 25 日
コメント済み: Dyuman Joshi 2022 年 9 月 25 日
Hi @all,
My question is a bit basic but I am confused I am getting error in that.
I have equation and I have to find its values for its unknown. The equation is:
E_t = @(t) 1.3 + 0.44 * sin(2 * pi *t)+ 0.10 * sin(3 * pi * t);
t = 0:0.05:10;
Now when I run:
output = E_t(t)
It gives me following error:
Invalid text character. Check for unsupported symbol, invisible
character, or pasting of non-ASCII characters.
I am confused what I am doing wrong here. Can anyone please guide me about it? Any help will be highly appreciated. thanks in advance.

採用された回答

Dyuman Joshi
Dyuman Joshi 2022 年 9 月 25 日
編集済み: Dyuman Joshi 2022 年 9 月 25 日
It seems like you have copy-pasted the expression from somewhere, and the text is not compatible.
Manually write the expression and you will be good to go -
E_t = @(t) 1.3 + 0.44*sin(2*pi*t) + 0.1*sin(3*pi*t)
E_t = function_handle with value:
@(t)1.3+0.44*sin(2*pi*t)+0.1*sin(3*pi*t)
t = 0:0.05:10;
E_t(t)
ans = 1×201
1.3000 1.4814 1.6395 1.7547 1.8136 1.8107 1.7494 1.6403 1.4998 1.3469 1.2000 1.0749 0.9826 0.9284 0.9124 0.9307 0.9766 1.0428 1.1223 1.2094 1.3000 1.3906 1.4777 1.5572 1.6234 1.6693 1.6876 1.6716 1.6174 1.5251
  4 件のコメント
aliza mustafa
aliza mustafa 2022 年 9 月 25 日
Its resolved now.
Dyuman Joshi
Dyuman Joshi 2022 年 9 月 25 日
That's good to know.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by