Could someone advice me how to merge a vector of ‘single’ and a vector of ‘int8’ in Matlab?
In details:
Tektronix AWG waveform format: each wave point = data and markers. data = single precision float, markers = byte. So each point is 5 bytes. I have these vectors in matlab. Each up to 32Mpoints. How to merge them fast?
The only that I have for now:
signal, markers
fsingle = fopen('temp.tmp','w');
fwrite(fsingle, signal, 'single');
fclose(fsingle);
f8 = fopen('temp.tmp','r');
b = fread(f8, [4 Inf],'int8');
fclose(f8);
f8 = fopen('output.wfm','w');
fwrite(f8, [b, markers]', 'int8');
fclose(f8);
This works. How can I execute lines 1 to 6 without writing on disk? It seems there are no pointers to variables in matlab…
Will be thankful for every idea,
Andrew
You probably want to use
typecast:Basically this is almost like a pointer. You can look at your array of singles as bytes. Then you can Concatenate it with other byte arrays.