Info
この質問は閉じられています。 編集または回答するには再度開いてください。
subscripted assignment dimension mismatch
1 回表示 (過去 30 日間)
古いコメントを表示
Subscripted assignment dimension mismatch.
Error in guiast>pushbutton6_Callback (line 528) C(rowspan,colspan,1) = R1;
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in guiast (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)guiast('pushbutton6_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Here is the code
C(rowspan,colspan,1) = R1;
C(rowspan,colspan,2) = G1;
C(rowspan,colspan,3) = B1;
0 件のコメント
回答 (1 件)
David Young
2015 年 9 月 3 日
You do not say how rowspan and colspan are calculated, but the problem is that they do not match the size of R1 (or the other two arrays, probably). The solution depends on what you want. If rowspan and colspan are correct but you do not want the whole of R1, try
C(rowspan,colspan,1) = R1(rowspan, colspan);
% etc
assuming R1 is a 2-D matrix and rowspan and colspan represent a part of it.
If you want the whole of R1 etc. you can use
rowspan = 1:size(R1, 1);
colspan = 1:size(R2, 2);
to get the correct ranges.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!