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 Comment

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.

Sign in to comment.

 Accepted Answer

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

3 Comments

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})

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!