I want to ask how to define the partial fraction code single number located at the numerator?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
>> syms s
>> F=4(3*s+13)/(8*s^2+s+4)
F=4(3*s+13)/(8*s^2+s+4)
↑
Invalid expression. When calling a function or indexing a variable, use parentheses.
Otherwise, check for mismatched delimiters.
0 Kommentare
Antworten (2)
Arif Hoq
am 28 Jan. 2023
Verschoben: John D'Errico
am 28 Jan. 2023
use multiplication operator (*) before parentheses
syms s
F=4*(3*s+13)/(8*s^2+s+4)
0 Kommentare
John D'Errico
am 28 Jan. 2023
Bearbeitet: John D'Errico
am 28 Jan. 2023
Remember that MATLAB does not understand implicit multiplication. That is, 4x is not interpreted as 4*x. In MATLAB, 4x is just a syntax error. (With the subtle and singular exception that things like 1i are interpreted by the parser as 1*sqrt(-1).)
What did MATLAB tell you? That MATLAB had a problem where the little arrow points. And you already knew to use 8*s^2, to form that product in another place, so you do apparently understand the need for an * operator.
This works of course:
syms s
F=4*(3*s+13)/(8*s^2+s+4)
Error messages usually try to point out where a problem lies. In this case, MATLAB was confused. It saw this:
4(3*s+13)
and said, ok, 4 must be a function, and 3*s+13 is the argument to that function. Wait, a number cannot be the name of a function. So then 4 must be a variable, since parens are also used to index into a variable. But then 4 is not the name of a variable either. As that point, MATLAB just gave up and threw an error.
Computers are easily confused.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Conversion Between Symbolic and Numeric finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
