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

1 visualización (últimos 30 días)
Rémi St-Laurent
Rémi St-Laurent el 23 de Sept. de 2019
Respondida: Rémi St-Laurent el 23 de Sept. de 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 !!!

Respuestas (2)

madhan ravi
madhan ravi el 23 de Sept. de 2019
Editada: madhan ravi el 23 de Sept. de 2019
clear all % you're probably shadowing the inbuilt function input()\fprintf()
%or
clear input fprintf

Rémi St-Laurent
Rémi St-Laurent el 23 de Sept. de 2019
Thank it works ahahahah

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by