numbers and characters in same vector

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?

답변 (1개)

John D'Errico
John D'Errico 2019년 10월 12일

1 개 추천

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'

카테고리

도움말 센터File Exchange에서 Numeric Types에 대해 자세히 알아보기

질문:

2019년 10월 12일

답변:

2019년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by