MATLAB Answers

Index in position 1 exceeds array bounds (must not exceed 1)

12 views (last 30 days)
Rémi St-Laurent
Rémi St-Laurent on 23 Sep 2019
Answered: Rémi St-Laurent on 23 Sep 2019
This is my script :
kwh=input('How much KWH this month :');
ckwh=6.6*kwh/100;
fprintf('Your charge for %5d will be %.2d',kwh,ckwh)
Matlab return this : Index in position 1 exceeds array bounds (must not exceed 1).
Help me please !!!

  0 Comments

Sign in to comment.

Answers (2)

madhan ravi
madhan ravi on 23 Sep 2019
Edited: madhan ravi on 23 Sep 2019
clear all % you're probably shadowing the inbuilt function input()\fprintf()
%or
clear input fprintf

  0 Comments

Sign in to comment.



Translated by