필터 지우기
필터 지우기

read a file.dat from matlab

조회 수: 2 (최근 30일)
Souhir FH
Souhir FH 2016년 3월 2일
답변: Walter Roberson 2016년 3월 2일
Hello, I would like to read a file.dat wich contains pixels, this file is generated from code composer studio , how can i display this image in matlab? thanks

답변 (1개)

Walter Roberson
Walter Roberson 2016년 3월 2일
fid = fopen('TheFile.dat', 'r');
pixels = fread(fid, inf);
fclose(fid);
Image_Array = reshape(pixels, ... some appropriate dimensions ... );
image(Image_Array);
You need to know the shape (rows, columns, number of color channels), or those have to be stored in the file. Watch out for whether the data was stored "across" (fairly common) or "down" (what MATLAB expects.)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by