numbers and characters in same vector
1 回表示 (過去 30 日間)
古いコメントを表示
I have a column in excel with bank account IDs which are a mix of numbers and characters:
347
345
4567bgr
345&tty
and I want to store them in a column vector, so that I can run aloop through the vector for each ID later. How can I do that?
0 件のコメント
回答 (1 件)
John D'Errico
2019 年 10 月 12 日
Store them in a cell array, actually a cell vector.
help cell
Index a cell array using curly braces, instead of parens. Thus {}, not ().
C = {'347'
'345'
'4567bgr'
'345&tty'};
C
C =
4×1 cell array
{'347' }
{'345' }
{'4567bgr'}
{'345&tty'}
C{3}
ans =
'4567bgr'
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!