converting vector to matrix

1 次查看(过去 30 天)
zina ben
zina ben 2012-6-27
Hello!
I want to convert vector:
V = [1 2 3 4 5 6 7 8 9]
To
V1 = [ 1 2 3; 4 5 6; 7 8 9 ]
Is there a Matlab command that will let me do this? or this needs to be coded? pleas help me Thanks in advence

回答(1 个)

Tom
Tom 2012-6-27
doc reshape
in this case:
V1=reshape(V,3,3)
  3 个评论
Tom
Tom 2012-6-27
That's the last time I answer a question without having Matlab open.
Sean de Wolski
Sean de Wolski 2012-6-27
@Tom, MATLAB Answers law 1:
-If you post something on MATLAB Answers without checking it, it will contain a typo!

请先登录,再进行评论。

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by