how to convert a matrix to a cell array

A
Ananyasingh · Jul 24, 2020 · 2K views
Question
I have a 2x10 matrix. Would anybody know how I could convert it into a 1x10 cell array - so that each cell contains a 2x1 matrix? I'm new to matlab and would appreciate any help.
Expert Answer
Profile picture of Prashant Kumar
Prashant Kumar PhD Expert
Answered Aug 17, 2026
please read about functions num2cell and mat2cell
eg:
 
out = num2cell(yourmatrix,1)

or

out = mat2cell(yourmatrix,2,ones(1,size(yourmatrix,2)))
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

Get a Free Consultation or a Sample Assignment Review!