cant put char array in a table of char!

조회 수: 14 (최근 30일)
Robert
Robert 2021년 7월 26일
댓글: Walter Roberson 2021년 7월 26일
No sure how this is even possible.
I have a table of type char and im trying to put char array in a location using { } brackets.
It wont work nor will it work with parentshs ()
The char table will only accept an integer
How is that even possible????
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 7월 26일
Could you show how you create the table?
Steven Lord
Steven Lord 2021년 7월 26일
Can you also show the specific error and/or warning (if any) that you receive when you try to add data to the table? Show the full and exact text of any messages (don't leave any parts out, don't paraphrase.)

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

답변 (1개)

Peter Perkins
Peter Perkins 2021년 7월 26일
편집: Peter Perkins 2021년 7월 26일
Don't use raw char arrays other than a char row vector. You will eventually be unhappy. Unless you are using a very old version of MATLAB, use string arrays. Next best would be a cell array of char row vectors. With no code and no error msgs, impossible to give specific advice.
I'll assume that by "table", you don't mean MATLAB's table datatype.
  댓글 수: 2
Peter Perkins
Peter Perkins 2021년 7월 26일
I see now that this is probably motivated by this. See my reply there. In short: I think you've accidentally backed into a corner that you don't want to be in. Use string.
Walter Roberson
Walter Roberson 2021년 7월 26일
And if char really is needed instead of string, then there are ways to proceed, but we need to be told the details of how wide the char arrays would need to be in order to make the best recommendations.

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by