cant put char array in a table of char!

5 views (last 30 days)
Robert on 26 Jul 2021
Commented: Walter Roberson on 26 Jul 2021
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????
Steven Lord
Steven Lord on 26 Jul 2021
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.)

Sign in to comment.

Answers (1)

Peter Perkins
Peter Perkins on 26 Jul 2021
Edited: Peter Perkins on 26 Jul 2021
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.
Walter Roberson
Walter Roberson on 26 Jul 2021
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.

Sign in to comment.





Community Treasure Hunt

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

Start Hunting!

Translated by