Effacer les filtres
Effacer les filtres

creating new matrix from another one

1 vue (au cours des 30 derniers jours)
babak
babak le 23 Sep 2012
>> enz=[];
>> enz=zeros(8,3);
>> for ii=1:14
for jj=1:3
match=ismember(file1,rxn)
if match(ii)==1
enz(ii,jj)=rxn(ii,jj)
end
end
end
rxn is 14x3, and file1 is 8x1 . i found the contents of the file1 in rxn and now i'm going to copy the whole contents of related rows(the rows that contains the same contents) in rxn to a new matrix, which should creat a 8x3 matrix, but i cant shape this matrix

Réponses (1)

Image Analyst
Image Analyst le 23 Sep 2012
You need to use the 'rows' option of ismember to find matching rows. Something like, (untested)
matchingRows = ismember(file1, rxn, 'rows');
enz = rxn(matchingRows, :);

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by