0

我有一个 512x512 uint8 图像,我想显示图像的矩阵元素,我使用了 disp(),但出现错误说(使用 disp 时出错。输出参数太多。)我应该如何显示矩阵的元素图片。

程序是

Z=imread('C:\Documents and Settings\ms polichand\My Documents\Downloads\brodatz.tiff');
figure();
imshow(Z);
A=disp(Z);

错误是

使用 disp 时出错 输出参数过多。

图像矩阵中的错误(第 6 行)A=disp(Z);

我应该怎么办?

4

1 回答 1

0

The error states that you have too many output arguments. Your code was

A=disp(Z);

The output arguments are anything to the left of the = so in this case A. Since you only have one single output argument* and the error says that that is too many then logically it means that the disp function accepts only zero output arguments. In other words you can only call it like this:

disp(Z)

*Note: a common example of having more than one output argument is [m,n]=size(Z)

于 2014-10-28T14:28:50.210 回答