How to load data from DAT file

Hi guys
can someone please help me with extracting data from .dat file. I wanted to attach an example file but it was to big.
I have tried the following codes but was unsuccesful. I would appriciate any input on this. Thanks!
fileID = fopen('example.dat');
OneByte = fread(fileID,'*ubit8');
A=double(OneByte);
%%
[filename directory_name] = uigetfile('*.dat', 'Select a file');
fullname = fullfile(directory_name, filename);
data = load(fullname)
%%
[FileName,PathName] = uigetfile('*.dat');
localdir = dir;
cd(PathName);
load(FileName);
cd('C:\Users\username\Documents\MATLAB\cd');

댓글 수: 4

Walter Roberson
Walter Roberson 2020년 6월 10일
unfortunately there is no standard format for the .dat extension, so documentation about the file format would be needed.
ALDO
ALDO 2020년 6월 10일
I will try and find a way to attach it. thanks
ALDO
ALDO 2020년 6월 10일
This was very helpful. Thank you so much!

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Search Path에 대해 자세히 알아보기

태그

질문:

2020년 6월 10일

편집:

2020년 6월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by