I have some results from my codes. Their class are different to each other. I write these values into microsoft word. I can assign global and char data into word with fprintf but when it comes to cell data I can't find anyway to write it.

7 views (last 30 days)
[fileName, filePath] = uiputfile('*.doc', 'Create a file:')
if ~ischar(fileName)
return;
end
fileID = fopen(fullfile(filePath, fileName), 'w');
dx=100 %global
formatSpec = 'dx(m) '; %char
formatSpec2=0.005; %global
formatSpec2=num2str(formatSpec2) %char
formatSpec2_2=100; %global
fprintf(fileID,'%3s %20s %30f\n',formatSpec,formatSpec2,formatSpec2_2)
cellArray=
'p.4004'
'p.4005'
'p.4007'
'p.4009'
cellArray 4x1 1240 cell global
%how can I write this cellArray into microsoft word as they appear?
fclose(fileID)

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 3 Aug 2013
Edited: Azzi Abdelmalek on 3 Aug 2013
cellArray={'p.4004'
'p.4005'
'p.4007'
'p.4009'}
fileID = fopen('fic.txt', 'w');
fprintf(fileID,'%s\n',cellArray{:})
fclose(fileID)

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!