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

1 次查看(过去 30 天)
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 !!!

回答(2 个)

madhan ravi
madhan ravi 2019-9-23
编辑:madhan ravi 2019-9-23
clear all % you're probably shadowing the inbuilt function input()\fprintf()
%or
clear input fprintf

Rémi St-Laurent
Rémi St-Laurent 2019-9-23
Thank it works ahahahah

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by