save a data as mat file

5 views (last 30 days)
Rica
Rica on 6 Nov 2012
i have this code:
%
if true
% code
%
for i=113:113
data=[];
fileID = fopen(['Printout_' num2str(i) '.txt']);
block = textscan(fileID, '%s','Delimiter','\n');
data=[data; block];
fclose(fileID);
compact_data=vertcat(data{:});
compact_data(1:29:end)=[];
compact_data(1:28:end)=[];
result_file=fopen(['result_probe_' num2str(i) '.txt'],'w');
fprintf(result_file,'%s\r\n',compact_data{1:1:end});
clear all
end
end code
I want to save the compact data as mat-file. that means i dont want to save it as text file (fprint.....)
I hope you could help me
thanks

Accepted Answer

Kye Taylor
Kye Taylor on 6 Nov 2012
try
save yourMatFile.mat compact_data

More Answers (0)

Categories

Find more on Large Files and Big Data in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!