MATLAB: Converting matlab output to txt format

convert matlab out to txt format

Hi people, pls help; i wrote a matlab program to find the logarithm of the average of a signal energy for twenty(20) different audio files. for each session of my code, i saved my output as 'E'and matlab display E=…. for all different 20 audio files. but what i want is for matlab to display my answer together as a [20,1] matrix. that is E=………. for all 20 answers instead of displaying individual answer. does anyone know if it is possible for me to achieve this? secondly, is it possible to automatically convert my output to txt format? i will appreciate any assistants. thanks

Best Answer

Alternatively the data can be written straight away, without saving it in an intermediate matrix:
fid = fopen(filename);
for k = 1:20
... read file
... calculate energy
fprintf(fid,...)
end
flcose(fid)