csv file wrong numbers filled with MATLAB

8 Ansichten (letzte 30 Tage)
Achraf El Euch
Achraf El Euch am 20 Mär. 2023
Kommentiert: Achraf El Euch am 22 Mär. 2023
Hello,
I am trying to fill a csv table in every loop in MATLAB but the values visible in the Excel file are wrong.
Details:
I am filling the csv file inside the function called myPlotFcn (attached a screenshot of the function definition) and It is called in the main script using 'solve' (attached the script too)
The excel file that I am getting is attached too, and 13577.5 was supposed to be 13577 and the value 124066999999999 was supposed to be 12406, I checked the values in MATLAB before that they get sent to the csv file.
I would be very grateful for any help with this :)
Thank you

Akzeptierte Antwort

dpb
dpb am 20 Mär. 2023
Verschoben: dpb am 20 Mär. 2023
"(attached a screenshot of the function definition)..."
Don't use images for code; attach the text and format the code. Nobody can do anything but look at an image.
If you want rounded, integer values and not exact, then use one of the rounding functions first, depending upon the type of rounding desired. See round, floor, ceil ...
  1 Kommentar
Achraf El Euch
Achraf El Euch am 22 Mär. 2023
Thank you, I used round and the problem is gone :)
concerning the code, I am new here, but I will do It next time then !

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by