フィルターのクリア

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 Center および File ExchangeData Type Conversion についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by