How to display data without single quotes in matlab command window?

This is the code:
filename = 'Fixed.txt';
filepath = 'C:\Users\admin\Desktop\numberPlateExtraction';
file= fullfile(filepath, filename);
fid = fopen(file, 'rt');
fread(fid, 15, '*uchar');
data_cell = textscan(fid, '%s', 'CommentStyle' , {'File', '\t'},'CollectOutput',1);
fclose(fid);
data = data_cell{1};
Original output:
data =
'+91245XXXXXXX'
Required output:
data =
+91245XXXXXXX
[EDITED, Jan, Code formatted]

1 个评论

To be exact: The posted code does not output anything at all. So please explain, how you create the output. I guess you mean the contents of data, but it is not clear, if it contains quotes or not.

请先登录,再进行评论。

 采纳的回答

Three guesses:
fprintf('%s', data)
disp(data)
disp(strrep(data, char(39), '')) % CHAR(39) is the quote '

3 个评论

First one shows: Error using fprintf Function is not defined for 'cell' inputs.
Error in split (line 9) fprintf('%s', data)
The other two guesses also show single quotes.: '+917043XXXXXX'
@swetha: Fine. Then data is a cell string?
class(data)
Then use:
fprintf('%s', data{1})
or
disp(data{1})

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Large Files and Big Data 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by