MATLAB Answers

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

8 views (last 30 days)
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

  0 Comments

Sign in to comment.

Accepted Answer

Stephen Cobeldick
Stephen Cobeldick on 16 Jan 2020
>> reshape(V,2,[]).'
ans =
1 2
3 4
5 6

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by