concatenating matrices of a cell vertically
조회 수: 1 (최근 30일)
이전 댓글 표시
i have a cell(1,n)=A of matrices (, the matrices have the same number of colums , and different number of rows . i want to concatenate all the matrices in the cell vertically using cat(1,M1,M2). i tried the following code ,but it doesn't work
for i=2:n
B(i-1)=cat(1,A{i-1},A{i});
end
B(:)
the following error appears
Error while evaluating uicontrol Callback
In an assignment A(I) = B, the number of elements in B and I
must be the same.
Error in Spro>export_button_Callback (line 1163)
B(i-1)=cat(1,A{i-1},A{i});
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in Spro (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)Spro('export_button_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
댓글 수: 0
채택된 답변
Image Analyst
2014년 1월 25일
What about this:
A = {ones(4,1),ones(5,1),ones(4,1),ones(5,1)}
allACells = cell2mat(A')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!