[Scilab-users] Having issues loading .TXT file

philippe rouxph.22 at gmail.com
Fri Jul 7 23:25:46 CEST 2017


Hi,

Le 07/07/2017 à 17:55, cnee1 a écrit :
> I have a large matrix from a .txt file.  
> 
> In Matlab the command is:
> 
> fname='MRS101916sr007_r70';
> ext='.txt';
> data=load([fname,ext]);
> 
> snum='MRS101916sr0117';
> 
> 
> What would it be in Scilab? 

use "mgetl" as below :

 fname='MRS101916sr007_r70';
 ext='.txt';
 data=mgetl(fname+ext);

data will be a vector of strings (nx1 matrix)  where each line of fname
is a string of dat).

The "load" function loads scilab  variables saved in a binary file with
.sod extension.  try "help load" in the scilab console to get more
informations.


> 
> My matrix will be a large n x 6 matrix.   n = data points that may exceed
> 400,000... 

if you want to read a matrix from a text file  you should use
"fscanfMat"  see "help fscanfMat" and "help scanf_conversion" in scilab
console for more information .

Philippe




More information about the users mailing list