Info

この質問は閉じられています。 編集または回答するには再度開いてください。

searching the occurances of a numeric in a cell array

2 ビュー (過去 30 日間)
hiva
hiva 2016 年 1 月 6 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
my first array is :
>> a=combnk([1:5],2)
and the first row of my second array which is a cell array is
{'12341345623414374538556438835454342345'}
now what i want is to search the first row of my first array which is [4 5] and also the reverse of it [5 4] in the first row of my second array.(and then i gotta do the same for the rest of the rows of cell array) any idea how i can convert [4 5] to '45' so that i can make use of strfind for this? or any other alternative solution?

回答 (1 件)

Ingrid
Ingrid 2016 年 1 月 6 日
I think using strfind would be a good way, just use sprintf() to format your numbers into a string or use num2string() twice if it are really only two numbers
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 1 月 6 日
char([4 5]+'0')

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by