Breaking a single matrix to multiple matrix.

1 view (last 30 days)
Hello everyone, I need your help.
I have a csv file which contain 100 lines of data with 3 values in each line. When i did csvread function and assigned it a name it resulted in a 100X3 matrix . I want to break data in 2 X3 matrices. I want to save all the set of 50 ( 2X3 matrices) as a variable. Please suggest me some solutions.???

Accepted Answer

KSSV
KSSV on 23 Oct 2020
Edited: KSSV on 23 Oct 2020
A = rand(100,3) ;
[r,c] = size(A);
p = 100/2; % this gives 50
out = permute(reshape(A',[c,r/p,p]),[2,1,3]);

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!