is there a way to make "short" variable in matlab?
Mostra commenti meno recenti
I'm using some code to read a file
The file goes like this:
D8 00 EA 00
the real values goes like this:
-40, -22
but if I read to code like this it doesn't work
for n=0:9999
n
filename = sprintf(filename_format,n);
fileID=fopen(filename,'r');
for i=1:784
z(n+1,i)=fread(fileID,1,'int16');
end
fclose(fileID);
end
end
it would return 218 234
1 Commento
Rik
il 12 Set 2022
I would have expected this to work. As a workaround you could try reading it as uint16 and then using cast or typecast (I always forget which one doesn't change the underlying data). I'm on mobile so I can't easily test code for you.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Data Import and Analysis in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!