Matlab resizing a matrix
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Ameer Hamza
2020-10-25
编辑:Ameer Hamza
2020-10-25
Try this interp1() based solution.
M = rand(8314, 3);
M_new = interp1(linspace(0,1,size(M,1)), M, linspace(0,1,144));
0 个评论
更多回答(1 个)
David Hill
2020-10-25
Not sure how you want to select the elements between the first and last.
newMatrix=reshape([yourMatrix(1:58:end),yourMatrix(end)],[144],[]);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Waveform Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!