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

조회 수: 2 (최근 30일)
Rémi St-Laurent
Rémi St-Laurent 2019년 9월 23일
답변: Rémi St-Laurent 2019년 9월 23일
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