登录论坛

查看完整版本 : 【求助】image和imagesc


249573317
2008-03-10, 16:23
[x,y]=meshgrid(-2:0.5:2,-2:0.5:2)
t=x.*exp(-x.^-y.^2)
[px,py]=gradient(t,0.05,0.05)
td=sqrt(px.^2+py.^2)
subplot(221)
imagesc(t)
subplot(222)
imagesc(td)
colormap('gray')
运行,无图象
??? Error using ==> image
Error using ==> image
Image CData can not be complex.

Error in ==> imagesc at 19
hh = image(varargin{1},'CDataMapping','scaled');

Error in ==> wangge at 6
imagesc(t)
。。。这是怎么搞的,用which imagesc 查到imagesc-M文件,没有新建过同名文件。
image和imagesc有何区别?

shiqiang
2008-03-10, 17:59
t=x.*exp(-x.^2-y.^2)你的程序中是不是应该是这个样子的。。

shiqiang
2008-03-10, 18:00
改正之后运行结果正常,你尝试一下,看看是不是问题出在这。