when i run "fprintf(-), this message shows up. Why? This is not an error.

>> sandy_eig(plant,controller,cost)
* was unexpected at this time.
Plant model # 1
Eigenvalues Damping Frequency(rad/sec) Frequency (Hz)
-0.27573 0.28338i 0.697 0.39538 0.06293
-0.27573 -0.28338i 0.697 0.39538 0.06293
-0.82946 0.00000i 1.000 0.82946 0.13201
-11.84036 5.56036i 0.905 13.08096 2.08190
-11.84036 -5.56036i 0.905 13.08096 2.08190

3 Comments

We will need to see the fprintf() call. If you create the format before the call, we will need to see the code that creates the format as well.
Looks like an error to me:
"fprintf(-),
String is not terminated properly.
The pasted code in the subject line is isolated from the context -- as @Stephen23 shows, by itself a different error is generated. The interpreter on the real code didn't like where the " is placed in whatever is the whole line or lines of code. As @Walter Roberson notes, will need to see the whole context to interpret.
But, there's more wrong besides the odd/mismatched double quotes character, the isolated minus as the argument is bad syntax as well
fprintf(-)
Unexpected ')'. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

Sign in to comment.

Answers (0)

Asked:

on 10 May 2026 at 10:19

Edited:

dpb
on 10 May 2026 at 14:53

Community Treasure Hunt

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

Start Hunting!