save a data as mat file

2 visualizaciones (últimos 30 días)
Rica
Rica el 6 de Nov. de 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

Respuesta aceptada

Kye Taylor
Kye Taylor el 6 de Nov. de 2012
try
save yourMatFile.mat compact_data

Más respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by