Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
Show older comments
Why does MatLab keep telling me this about my program? I need some help please.
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To
construct matrices, use brackets instead of parentheses.

2 Comments
Darrell
on 14 May 2023
sol=inv'double'[A]*b
Walter Roberson
on 14 May 2023
I do not recognize that programming language, but I am certain it is not MATLAB.
Accepted Answer
More Answers (1)
Walter Roberson
on 28 Feb 2020
0 votes
MATLAB has absolutely no implicit multiplication. (A)B is never valid in MATLAB.
A(B) in MATLAB would always indicate either indexing or function call and never multiplication. Your m(L-xa) is either indexing m at location L-xa or else is calling function m. It does not mean to multiply m by L-xa
In every case in MATLAB if you want to multiply two values, you need to use the .* operator for element-by-element multiplication, or the * operator for algebraic matrix multiplication (inner product)
5 Comments
Tyler
on 28 Feb 2020
Walter Roberson
on 29 Feb 2020
Find every place that you intend for there to be multiplication. If there is presently no operation at that point in the code, insert .* there. If there is * at that point in the code, change it to .*
For example (Tb-Tinf).*cosh
Tyler
on 29 Feb 2020
Tyler
on 29 Feb 2020
Walter Roberson
on 1 Mar 2020
Ta = Tinf+ (Tb-Tinf)cosh(m(L-xa))/cosh(m*L); plot(xa,Ta,'ok','Linewidth',1)
As you would have followed my instructions to put .* everywhere that multiplication was intended, then we have ot ask what your intention is for the expression (Tb-Tinf)cosh(m(L-xa)) if it is not multiplication between (Tb-Tinf) and cosh(m(L-xa)) ? And what is your intention for the expression m(L-xa) if you did not intend multiplication between m and (L-xa) ?
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!