- What is your input, in matlab?
- What is your expected output?
- What did you try, in code?
- What is the exact error matlab returned?
How to convert a cell to a string?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have attempted to convert a cell to a string using cellstr (which doesn't work)... I need a column of cells (all containing numbers) to be strings so I can manipulate them. Thank you!
7 commentaires
Jan
le 20 Fév 2018
Modifié(e) : Jan
le 20 Fév 2018
@Lexington Stoyell: Flags are used to mark inappropriate message, but Birdman ask you to provide your input, such that the readers can help you. Therefore I've removed your flag "Um why?". The answer is trivial: Because Birdman wants to help you and needs details to do so.
You do not tell us, what exactly your inputs are and what the error message is - although you have been asked for this twice already. This makes it hard to help you.
The column is said to be a cell.
Please explain this clearly. Who said what?
I want to convert this to a string so I can then use strsplit() and use
the comma as a delimiter to split the column into two different columns.
This is not clear also. There is no unique conversion of a cell, which contains numbers to a string. There is no need to concatenate the converted numbers only to split them afterwards.
[~, ~, dat] = xlsread('My_File.xlsx');
A = Value_Col;
B = Limits_Col;
H = cellstr(B);
What is the purpose of this code? dat is not used. Value_Col and Limits_Col are defined elsewhere and I cannot even guess, what they contain.
This is your 3rd thread about this topic and you still do not answer the questions for clarifications. See Question 382677 and Question 382677.
Please post your input and tell us exactly, what you want as output. Leave the idea of "splitting a column into 2 columns at the comma", because this is not meaningful. Vectors do not contain commas, but they are inserted for a better display on the screen only. Show us the contents of the Excel file and explain, what you want to achieve.
Réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!