How to convert a cell to a string?

4 次查看(过去 30 天)
Lexington Stoyell
Lexington Stoyell 2018-2-14
编辑: Jan 2018-2-20
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 个评论
Jan
Jan 2018-2-20
编辑:Jan 2018-2-20
@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 2018-2-20
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by