i have a big matrix with dimension 303*14 i want compare every row of this matrix with one vector with dimension 1*14
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
i have a big matrix with dimension 303*14 i want compare every row of this matrix with one vector with dimension 1*14 all of these are cell arrays and contain string
6 件のコメント
Jan
2013 年 12 月 22 日
Ok. What is your question then? What kind of comparison do you want? How do the wanted results look like? Could you give us an explicit example?
fatemeh
2013 年 12 月 22 日
Jan
2013 年 12 月 22 日
@fatemeh: Please give us an example with a {2 x 3} cell string and a {1 x 3} pattern. Of course you can apply strcmp row by row using a FOR-loop.
fatemeh
2013 年 12 月 22 日
fatemeh
2013 年 12 月 22 日
Jan
2013 年 12 月 22 日
In opposite to your question, the example data do not contain strings, but scalar numbers. This is confusing.
"Doesn't work" is not precise enough to offer a suggestion for improvements. Perhaps it is only a typo in "strcomp", which is written without "o"? Posting the error message would be more helpful.
回答 (1 件)
Wayne King
2013 年 12 月 22 日
編集済み: Wayne King
2013 年 12 月 22 日
I'm not sure I understand, you say you have a cell array:
strcmp() does work element by element on a cell array.
A = {'This is a frog'; 'This is a chair'; 'This is a book'; 'This is a test'};
strcmp(A,'This is a test')
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!