Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How can I change my fprint error

1 vue (au cours des 30 derniers jours)
Yixuan Zhang
Yixuan Zhang le 15 Sep 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021

Réponses (1)

Image Analyst
Image Analyst le 15 Sep 2019
Modifié(e) : Image Analyst le 15 Sep 2019
You can't use the Ice array itself for indexes since they're floating point and indexes need to be like 1, 2, 3, 4, 5 etc. (integers starting at 1). To fix:
fprintf('Ice thickness for %d days = ', length(Ice));
fprintf('%.3f, ', Ice);

Community Treasure Hunt

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

Start Hunting!

Translated by