Matlab keeps giving me error for invalid syntax! I don't understand why

3 views (last 30 days)
I wrote this programm, Matlab keeps giving me error in line 38.
The programm is about finding and providing solutions, if they exist, of a generic quadratic equation.
  2 Comments
RICCARDO CASET
RICCARDO CASET on 29 Jul 2022
Edited: RICCARDO CASET on 29 Jul 2022
I attached the code in the comments. Sorry it's the first time using these applicatives!

Sign in to comment.

Accepted Answer

Voss
Voss on 29 Jul 2022
Missing comma:
% fprintf('Le soluzioni distinte sono %12.2f \n' A1, A2)
% ^ no comma
fprintf('Le soluzioni distinte sono %12.2f \n', A1, A2)
% ^ comma

More Answers (1)

Jonas
Jonas on 29 Jul 2022
looks like you are missing a comma
if d>0
fprintf('Le soluzioni distinte sono %12.2f \n',A1 , A2)
end

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!