Hi all: I got a problem to use 2 MATLAB commands in LabVIEW properly: fread and reshape. The example code is as follows:
fi = fopen('c:\temp\test.spe','r');
header = fread(fi,2050,'uint16=>uint16');
Xdim = header(22);
Ydim = header(329);
Zdim = header(724);
Im = fread(fi,inf,'int16=>int16');
fclose(fi);
wh = reshape(double(Im),Xdim,Ydim,Zdim);
You see that the file is binary one. There are many headlines in this file, following by a 3-D array data. I need to get the dimensions for this data (in variable "header"), then read the data (in variable "Im"), and re-arrage the data according to its size (in variable "wh").
I wish someone can give me a direction how to do this in LabVIEW. By the way, I close the file using fclose because of the limit of computer memory. How can I do it in LabVIEW?
Thank you for any of your suggestions.