How to convert a cell to a string?

5 vues (au cours des 30 derniers jours)
Lexington Stoyell
Lexington Stoyell le 14 Fév 2018
Modifié(e) : Jan le 20 Fév 2018
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
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.
Lexington Stoyell
Lexington Stoyell le 20 Fév 2018
I want to ensure that the values (shown in the Excel picture) are between the upper and lower limits, which could be an array/matrix...for this reason I want to split the cell depending on comma placement. I am also unsure how to compare the cells using greater than or less than.

Connectez-vous pour commenter.

Réponses (0)

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!

Translated by