Question
Hello. I am trying to convert a 100*2 matrix to 2*100 matrix. I appreciate if you give me any idea. The reason is I need to find the pick of negative data at second column, and I am using following code: NEG=[find(E(:,1)<0) E(E(:,1)<0,1)]; so for using following code I need my matrix be 2*100 EE=findpeaks(NEG(:,2));
Expert Answer
John Michell
PhD Expert
Answered Aug 24, 2026
To convert a horizontal matrix to a vertical matrix in MATLAB, you can use the transpose operation. Here’s a simple example:
>> A = [1,2;3,4;5,6;,7,8]
A =
1 2
3 4
5 6
7 8
>> A.'
ans =
1 3 5 7
2 4 6 8
Have a different question? Ask here
Related matlab Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →