How can i store string in cell without apostrophe?

5 Ansichten (letzte 30 Tage)
siddhesh rane
siddhesh rane am 25 Jul. 2013
Bearbeitet: Stephen23 am 25 Feb. 2021
I want to store say A50 in cell ..but i dont want apostrophes in it like 'A50'..how can i do it.?
I tried to use string to number and string to double but it didnot work.
Thanks in advance.

Akzeptierte Antwort

David Sanchez
David Sanchez am 25 Jul. 2013
M = cell(1,1);
str = 'A50';
str = char(str);
M{1} = str;
  5 Kommentare
siddhesh rane
siddhesh rane am 25 Jul. 2013
Bearbeitet: siddhesh rane am 25 Jul. 2013
thanks a lot sir..one last question
If i create a text file from the data then will it have apostrophes?
Stephen23
Stephen23 am 25 Feb. 2021
Bearbeitet: Stephen23 am 25 Feb. 2021
Note that char makes absolutely no difference when its input is already of type char:
A = 'A50' % variable A already has type char,
A = 'A50'
B = char(A) % so function CHAR does absolutely nothing here.
B = 'A50'
whos
Name Size Bytes Class Attributes A 1x3 6 char B 1x3 6 char
isequal(A,B)
ans = logical
1

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by