MATLAB Answers

0

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

Asked by Rémi St-Laurent on 23 Sep 2019
Latest activity Answered by 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.

2 Answers

Answer by madhan ravi
on 23 Sep 2019
Edited by 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.


Answer by Rémi St-Laurent on 23 Sep 2019

Thank it works ahahahah

  0 Comments

Sign in to comment.