Having issues loading .TXT file

classic Classic list List threaded Threaded
2 messages Options
cnee1 cnee1
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Having issues loading .TXT file

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?

I have used some functions but am confused, I saw a youtube tutorial:

https://www.youtube.com/watch?v=mY7EBULfJzY

However, when I tried this the result was nothing because it was unable to open my matrix.

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

Much appreciated.
Philippe Roux Philippe Roux
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having issues loading .TXT file

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

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Loading...