Vectorisation: Colon operator with floating point increment error
Mostra commenti meno recenti
Hi,
For y=400:1.6:1200; Expected output is =400, 401.6,...1198.4,1200.
But Matlab gives output in the form: 1.0e+03 *Columns 1 through 11 0.4000 0.4016 0.4032 ...1.200.
Can you advise how to get the expected output. If it has already been addressed, kindly share the link to look through.
Thanks!
Risposta accettata
Più risposte (1)
Walter Roberson
il 7 Apr 2019
Give the command
format long g
and then display the data again.
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!