Is there any built in MATLAB command that “stretches” out a multidimensional array into a linear array?
e.g [1,2;3,4] should be come [1,2,3,4]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
reshapecommand can do this:The empty array
[]indicates that MATLAB should calculate automatically how many elements should go in that direction (i.e., that you won’t have to specify the number of elements in your array).