How to pass a matrix (m, 1) to (m / 2.2)

조회 수: 1 (최근 30일)
Jose Antonio Tarrio Mosquera
Jose Antonio Tarrio Mosquera 2020년 1월 16일
답변: Stephen23 2020년 1월 16일
Hi:
Sorry for the maybe basic question
I am trying to find a function or script to pass matrices of type V = [1; 2; 3; 4; 5; 6] to V = [1 2; 3 4; 5 6]
The code is like that this:
V=[1;2;3;4;5;6]
%Reordenamiento de las matrices con errores XY separados
[f,c]=size(V)
for i=1:f
VV(2*i-1:i,1:2)=[V(i,1),V(i,2)];
end
Thank you

채택된 답변

Stephen23
Stephen23 2020년 1월 16일
>> reshape(V,2,[]).'
ans =
1 2
3 4
5 6

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by