[Scilab-users] [EXTERNAL] Count specific values in text file

Clément DAVID clement.david at scilab.org
Wed Feb 12 14:30:52 CET 2020


Hi all,

Nice challenge, I have a simple answer to display an histogram (with 10
classes) of the PI digits stored in a pi.txt file (without any dot
separator):

F="pi.txt";
fd = mopen(F, 'r');
histplot(ascii(strcat(string(0:9))), mget(fileinfo(F)(1), "c", fd));
mclose(fd);

The idea is to read the file using mget() and store each ascii value into a
vector. These data are plot as a histogram of "0" to "9" ascii value.

--
Clément



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html



More information about the users mailing list