Matlab resizing a matrix
2 views (last 30 days)
Show older comments
I have a matrix 8314 x 3 and want to cut it down to 144 x 3 while having the same start and end point.
0 Comments
Accepted Answer
Ameer Hamza
on 25 Oct 2020
Edited: Ameer Hamza
on 25 Oct 2020
Try this interp1() based solution.
M = rand(8314, 3);
M_new = interp1(linspace(0,1,size(M,1)), M, linspace(0,1,144));
0 Comments
More Answers (1)
David Hill
on 25 Oct 2020
Not sure how you want to select the elements between the first and last.
newMatrix=reshape([yourMatrix(1:58:end),yourMatrix(end)],[144],[]);
0 Comments
See Also
Categories
Find more on Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!