- 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
How to read Brimrose NIR spectral data
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, I am trying to read NIR data from Brimrose. File format is .dat, Pleae see the attached zip. If Notepad is used, all sorts of characters appear. I tired various matlab commads, fopen, load etc. no luck. Thank you for your help.
0 件のコメント
回答 (1 件)
Govind KM
2024 年 11 月 7 日 9:28
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:
Hope this is helpful!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!