How can i store string in cell without apostrophe?

2 ビュー (過去 30 日間)
siddhesh rane
siddhesh rane 2013 年 7 月 25 日
編集済み: Stephen23 2021 年 2 月 25 日
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.

採用された回答

David Sanchez
David Sanchez 2013 年 7 月 25 日
M = cell(1,1);
str = 'A50';
str = char(str);
M{1} = str;
  5 件のコメント
siddhesh rane
siddhesh rane 2013 年 7 月 25 日
編集済み: siddhesh rane 2013 年 7 月 25 日
thanks a lot sir..one last question
If i create a text file from the data then will it have apostrophes?
Stephen23
Stephen23 2021 年 2 月 25 日
編集済み: Stephen23 2021 年 2 月 25 日
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

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by