error "Index exceeds matrix dimensions." in my GUI
조회 수: 3 (최근 30일)
이전 댓글 표시
i can't fix this error
Index exceeds matrix dimensions.
Error in bulanan (line 11)
bar( mr(inthn).Rain );
Error in rancang1>pushbutton1_Callback (line 129)
bulanan
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in rancang1 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)rancang1('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
my code
pushbutton callback
RainData=handles.data
jeda = get(handles.listjeda,'value');
switch jeda
case 1
bulanan
case 2
harian
end
bulanan.m
inthn = get(handles.pilihtahun,'value');
switch inthn
case 1
1;
case 2
2;
end
mr = MonthlyRain( RainData );
bar( mr(inthn).Rain );
ylabel('Akumulasi Curah Hujan (mm)')
xlabel('Bulan')
댓글 수: 3
Walter Roberson
2013년 1월 28일
We need to know more about MonthlyRain and RainData. If MonthlyRain(RainData) is producing a scalar, you would get the problem.
채택된 답변
Walter Roberson
2013년 1월 29일
I have not checked your data file, but it appears your data file only has information for a single year. Your rain_data structure will only have as many array members as there are distinct years in your data.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!