change array into matrix

6 次查看(过去 30 天)
Anusha
Anusha 2014-2-1
评论: Anusha 2014-2-1
How to write a 4 values in rectangular grid a=[8 4 6 2]
it will become
a=
8 4
6 2

采纳的回答

Mischa Kim
Mischa Kim 2014-2-1
编辑:Mischa Kim 2014-2-1
Use the reshape command.
b = reshape(a,2,2)
  3 个评论
Mischa Kim
Mischa Kim 2014-2-1
Is this another question or are you confirming that the command does what you need it to do?
Anusha
Anusha 2014-2-1
if i have a array with 50 numbers how it will be converted into rectangular matrix

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by