Unexpected MATLAB expression.

i try to make equation but when i run have problem Unexpected MATLAB expression.
a=(T) 247.8./((T-273)+68.12963))
anyone can help me

回答 (1 件)

Stephen23
Stephen23 2018 年 7 月 4 日
編集済み: Stephen23 2018 年 7 月 4 日

1 投票

MATLAB does not have implicit multiplication between adjacent values or variables. You need to write the multiplication explicitly:
a = T .* 247.8./((T-273)+68.12963)
^^ You need this!
I also fixed the unmatched parentheses.

4 件のコメント

vaya putra
vaya putra 2018 年 7 月 4 日
thank you, why i try to write a=(T) not work sometime i have write like this?
Walter Roberson
Walter Roberson 2018 年 7 月 4 日
a = @(T) 247.8./((T-273)+68.12963))
would create a as a handle to an anonymous function that took T as an argument.
Image Analyst
Image Analyst 2018 年 7 月 4 日
If you just did
a=(T);
then that should work, but if you do
a=(T) 247.8./((T-273)+68.12963))
then there is no operator between the T) and the 247 and that causes a problem. Computer programming is not like writing or textbooks, where you can just leave out the multiplication symbol. If you want to multiply two things, like T and 2, or T and A, then you must put either a matrix multiplication operator, T*A, or an element-by-element operator T.*A.
vaya putra
vaya putra 2018 年 7 月 4 日
done, thank you very much Walter

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

カテゴリ

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

製品

リリース

R2017b

タグ

質問済み:

2018 年 7 月 4 日

コメント済み:

2018 年 7 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by