how to fill a matrix using the rows of another matrix
2 ビュー (過去 30 日間)
I have a matrix A of size 8540X18, there is a specific column in that matrix that its whenever the next row is less than the previous row, we need to extract all the rows before that row and store them in another matrix B and then store that matrix in a seperate data file. anybody can help with this?
回答 (1 件)
Salman Ahmed 2021 年 10 月 14 日
From the comments, I understand that you wish to segregate your data into different cells whenever you hit peaks in your data. You could try the following operations on your data:
idx = find(diff([0;A.GDALT])<0); % Finding the breakpoints
B = mat2cell(A,[idx(1)-1;diff(idx);numel(A.GDALT)-idx(end)+1]); % Segregating the tables
Hope it solves your issue.