matlab rawdata,如何用matlab 打开raw格式的文件啊?急.......

该函数`rawread`用于读取Portable Bitmap或RAW格式的图像文件。它支持PGM和RAW格式,可以读取文件头信息并创建灰度调色板。当文件尺寸未指定时,默认假设RAW文件的尺寸为256x256。如果文件读取长度不匹配,会抛出错误。最后,函数将图像数据转换为颜色映射索引并关闭文件。
摘要由CSDN通过智能技术生成

function [X,map] = rawread(filename,n,m);

% RAWREAD Read a Portable Bitmap file, or a raw file.

%       RAWREAD('imagefile.raw', xsize, ysize) reads a "raw" image file

%       RAWREAD('imagefile.pgm') reads a "pgm" (portable gray map) image

%       [X,map] = RAWREAD('imagefile.raw') returns both the image and a

%       color map, so that

%               [X,map] = rawread('imagefile.raw',sx,sy);

%       or      [X,map] = rawread('imagefile.pgm');

%               image(X)

%               colormap(map)

%       will display the result with the proper colors.

%

%       NOTE : map is optional and could be replaced during the display by

%              the "colormap('gray')" command

%

%       See also IMWRITE, IMREAD, IMAGE, COLORMAP.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值