octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63931] Binary fwrite writes incorrect data to


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #63931] Binary fwrite writes incorrect data to file
Date: Mon, 20 Mar 2023 13:53:22 -0400 (EDT)

Follow-up Comment #44, bug #63931 (project octave):

matlab 2022b:

comment #0 original test script: 

val = hex2dec('a7');
a = ones(2400,1)*val;
f = fopen('a.a','wb');
fwrite(f,a,'uint8');
fclose(f);

f = fopen('a.a','rb');
b = fread(f,2400,'uint8');
fclose(f);

a(1)
b(1)
ans =
   167
ans =
   167



 t1 script from comment #25:

>> clear
>> whos
>> t1
val =
  uint8
   193
cw =
     1
cr1 =
     1
x =
  uint8
   193
y =
   193
------
val =
  uint8
   194
cw =
     1
cr1 =
     1
x =
  uint8
   194
y =
   194
------
val =
  uint8
   195
cw =
     1
cr1 =
     1
x =
  uint8
   195
y =
   195
------
>> whos
  Name      Size            Bytes  Class     Attributes

  a         1x1                 1  uint8               
  ans       1x1                 8  double              
  b         1x1                 8  double              
  cr        1x1                 8  double              
  cr1       1x1                 8  double              
  cw        1x1                 8  double              
  f         1x1                 8  double              
  ii        1x1                 8  double              
  n         1x1                 8  double              
  val       1x1                 1  uint8               
  x         1x1                 1  uint8               
  y         1x1                 8  double              
            


not sure this is capturing the check you were looking for, though.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63931>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]