[Scilab-users] mput ( int16([1:len]), 's', fid ) ; Creates a file of 20296 bytes ! ! !

yannick mice.recorder at yahoo.fr
Thu Jan 10 15:35:08 CET 2019


Hello,

I try to go from MatLab to SciLab.

I am a little disturbed by my first tests, maybe the change of context ...

I'm probably using the instructions incorrectly, but my mistake is so huge
that I can not see it. 
Can you help me open my eyes?

The following code:
*
len = 10000 ;
fid = mopen( 'C:\Users\yoon\Documents\MATLAB\Dorian\SciLab.bin' , 'w+' );   

   mput ( int16([1:len]), 's', fid ) ;      mt1 = mtell(fid) ;
   mseek( 0 , fid  ) ; 
   rm = mget(len, 's', fid);

mclose(fid);  

printf('%i %i', mt1, length(rm))
*
creates a file of 20296 bytes. I expected exactly 20000...
mt1 == 20296.
Moreover "mget" reads only 25 short words.

If I simply changes "[1:len]" for "zeros(1,len)", every thing becomes ok,
(file size and rm length).

If I use double words instead short  " mput ( [1:len], 'd', fid ) ; "
 the file size is 80040    and rm's length 2060 !!!

  What's missing me?

  Thank's in advance,
   Yannick



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



More information about the users mailing list