Hello, I have a column in my table array called key_value.
The array contains a string such as '1234567891234|XYZ|9999'.
How do I code for each of these cells extract the first 13 characters?
I have tried key_value(1:13) but this does not work and simply pulls out the first 13 rows of records.

 채택된 답변

Walter Roberson
Walter Roberson 2014년 4월 14일

0 개 추천

cellfun(@(S) S(1:13), key_value, 'Uniform', 0)

댓글 수: 1

Matthew
Matthew 2014년 4월 14일
Walter, you're a star!
Thanks for your help!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Nitin
Nitin 2014년 4월 14일

0 개 추천

If you are accessing a cell array, you should use curly braces. Check out the examples here

카테고리

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

태그

질문:

2014년 4월 14일

댓글:

2014년 4월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by