Question
I have a cell array that looks like this: mydata = [10x11 double] [5x11 double] Name Size Bytes Class Attributes mydata 1x2 1544 cell I'm trying to convert this to a numeric array using the cell2mat function. But I keep getting the following error message: Error using cat Dimensions of matrices being concatenated are not consistent. Error in cell2mat (line 76) m{n} = cat(2,c{n,:}) Is it possible to convert a cell array whose dimensions are not equal?
Expert Answer
Neeta Dsouza
PhD Expert
Answered Aug 24, 2026
In your case, the matrices have a different number of rows so cannot be concatenated in this way. But, if your cell array mydata was a column (rather than a row) with the same two elements, then yes it could be concatenated because each matrix has the same number of columns
mydata = cell(2,1);
mydata{1} = zeros(10,11);
mydata{2} = ones(5,11);
mtx = cell2mat(mydata);
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related matrix Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →