25数值矩阵转换为灰度图像

152 阅读1分钟

close all;clear all;clc;

X=magic(256);

I= mat2gray(X); %将矩阵I转换为灰度图像

imshow(I); %显示转换后灰度图像

image.png