Unexpected MATLAB expression.
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Stephen23
2018-7-4
编辑:Stephen23
2018-7-4
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 个评论
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!