The content and structure of a .dat file depend on the application that created it. It is not tied to a specific type of data or format, which means it can be a text file, binary file, or any other data format. Documentation regarding the specific format of the Brimrose NIR data would be required to read the .dat file.
Once the format is known, some ways to read the file are:
- Right click on the .dat file and select Import Data. This opens an Import Tool which helps you import the data interactively with different options. More details can be found here: https://www.mathworks.com/help/matlab/import_export/import-data-interactively.html
- Another way is to use fopen to open the file and get a handle to the file (aka FileID). Once the file is opened, functions like fgetl, fscanf, fread, etc. can be used to read from it, ensuring that appropriate formatting is specified.
- Here is a related MATLAB Answers post with code to read a mock .dat file using the textscan function, used to read formatted data from a text file and store it in a cell array: https://www.mathworks.com/matlabcentral/answers/1697030-dat-file-to-a-readable-file-for-an-array-in-matlab
Hope this is helpful!