Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Alan
Posts:
48
Registered:
7/30/13


Re: Delete and insert row in different matrix
Posted:
Aug 20, 2013 2:51 PM


"John Dickson" wrote in message <kv0cn9$lpq$1@newscl01ah.mathworks.com>... > > A is 50*85 matrix and B is 30*85 matrix. All I need is to delete ith row in matrix A and insert it at the end of B matrix. New matrix will be A =49*85 and B= 31*85. > A and B are two different data sets which doesn't depend on anything. I select the row'i' > using a third matrix which is 30*50. If row i in the third matrix is the max of the minimums ([maxValue, rowIdx] = max(C(1,end),[],1)) then I remove ith row from A and insert it into B. I use the rowIDx to determine the ith row (row that has maxi of the minimum) which will help me to remove from A using A(rowIdx,:)=[] > I hope this information will help to solve my issue. > > Thanks
I think this will do what you need.
b(end+1,:) = a(i,:); %Copy row to bottom of B a(i,:) = []; %Delete row from A



