MATLAB Answers

0

How can I change my fprint error

Asked by Yixuan Zhang on 15 Sep 2019 at 17:45
Latest activity Edited by Image Analyst
on 15 Sep 2019 at 17:52

  0 Comments

Sign in to comment.

1 Answer

Answer by Image Analyst
on 15 Sep 2019 at 17:51
Edited by Image Analyst
on 15 Sep 2019 at 17:52

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);

  0 Comments

Sign in to comment.