Matlab help with sprintf()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Matlab help with sprintf()

Rik-4
I've suddenly come upon a lot of instances where Octave is not handling
NULL characters ('\0') in strings correctly.

Could someone try the following in Matlab?

double (sprintf ('\0'))

Octave is returning an empty matrix, but I think it should be a scalar
value of 0.

Thanks,
Rik


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: Matlab help with sprintf()

avlas-2
El dimarts, 13 de febrer de 2018, a les 16:23:09 EST, Rik va escriure:

  I've suddenly come upon a lot of instances where Octave is not handling
  NULL characters ('\0') in strings correctly.
 
  Could someone try the following in Matlab?
 
  double (sprintf ('\0'))
 
  Octave is returning an empty matrix, but I think it should be a scalar
  value of 0.
 
  Thanks,
  Rik
 
 
  -----------------------------------------
  Join us March 12-15 at CERN near Geneva
  Switzerland for OctConf 2018.  More info:
  https://wiki.octave.org/OctConf_2018
  -----------------------------------------
 
>> double (sprintf ('\0'))

ans =

     0

(Matlab 2017b)

...
a.




-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------