Help recreating MATLAB program in Excel - Parsing Binary Data

tylererhard

New Member
Joined
May 31, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am working on a project that parses data from a zygo interferometer (binary .datx file). I found some MATLAB Code that works well but for what I would like to do I would like this to be in Excel. I'm trying to do something like this but the data I'm parsing does not match the data the MATLAB code outputs... Could someone help point me in the right direction?

Sub LoadZygoBinaryTest()
Dim fileNum As Integer
Dim filename As String
filename = "Q:\16500-16599\16518 Keysight PBS\J6NR8\STEP 1600 - CP FACE B FIGURE\STEP 1600 CP SIDE B SN 17.datx"
fileNum = FreeFile
Open filename For Binary Access Read As #fileNum

Dim data As New Collection

' Read header
Dim magic_number As Long
Get #fileNum, , magic_number
data.Add magic_number, "magic_number"

Dim header_format As Integer
Get #fileNum, , header_format
data.Add header_format, "header_format"

And so on for each variable I'm parsing... Here is the raw .dat file you can use to check the analysis with. .dat file link

Thank you in advance!
Tyler
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,829
Messages
6,181,222
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top