Page 1 of 1

Getting statistical data from ASCII files in matlab

Posted: Sat Mar 25, 2017 1:02 pm
by K40555
Hi,

After I sample a couple of clouds in CC, saved them as ASCII files I want to read these files in matlab to obtain statistical data. Does anyone know a good way to do this or if there are any built in functions to do so in matlab?

Re: Getting statistical data from ASCII files in matlab

Posted: Mon Mar 27, 2017 7:16 pm
by daniel
It's a long time since I last used Matlab, but I remember reading a column-based ASCII file was really easy. Something like:

Code: Select all

A = fprintf(fileID,'%f %f %f %f %f %f\n');
Where you put as many '%f' as there are columns in the file.

(see https://fr.mathworks.com/help/matlab/ref/fscanf.html).