필터 지우기
필터 지우기

How to open Tonatiuh output .DAT files in MATLAB?

조회 수: 3 (최근 30일)
Muhammad Taha Manzoor
Muhammad Taha Manzoor 2021년 1월 21일
댓글: venu 2024년 1월 28일
Hi, I have output files from Tonatiuh ray-tracing software but I am unable to open this file in any other software. I was wondering if there is any way to open it in MATLAB so that I can perform the analysis that I need.
Any help would be appreciate in this regard. This is a binary output file with a .DAT extension. I am unable to uplaod the file here so I am attaching a One-Drive link if anybody wants to have a look.
  댓글 수: 3
Vishesh
Vishesh 2022년 10월 3일
The File link has expired now. So I am unable to access it.
For reading DAT file , you can use "fread" function.
  1. The "fread" function takes three arguments: the file identifier, the number of elements to be read, and the data type. Here is a link to a documentation page with more information. https://www.mathworks.com/help/matlab/ref/fread.html?searchHighlight=fread&s_tid=doc_srchtitle
  2. Each call to "fread" reads a number of bytes specified by the number of elements and the data type being read. The file pointer is left immediately after the last element read.
  3. Refer to the "precision" section of the above link to see which precision flags correspond to different data types/number of bytes.
venu
venu 2024년 1월 27일
편집: Walter Roberson 2024년 1월 27일
Respected sir,
I am also facing same problem did you done within please help me
please kindly help me

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 10월 3일
The file format is described at https://code.google.com/archive/p/tonatiuh/
You might find it useful to use memmapfile to define a structure describing the binary layout, as you would then be able to refer to the parts by name and MATLAB would automatically do all the binary I/O work necessary.
  댓글 수: 1
venu
venu 2024년 1월 28일
Respected sir,
When I open .dat file using matlab code there "n" number of number how can i under stand which value refers to what please help me sir.
for the reference i a attaching the values which i was extracted from my .dat file which is genertaed in tonatiuh software

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by