声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1411|回复: 4

[编程技巧] 求助:麻烦大家看一下,图2为什么画不出来?

[复制链接]
发表于 2012-5-12 09:55 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
clc;
clear;
x=random('norm',2,0.03,1,41);
y=random('norm',2,0.03,1,41);
figure(1)
plot(x,y,'.')
c0=340;
f=1000;
w=2*pi*f;
k0=0;
M=41;
syms kx ky
km=[kx,ky];
W=0;
image=sqrt(-1);
for m=1:41
    rm=[x(m),y(m)];
    pm=dot(km,rm);
    qm=exp(image*pm);
    W=W+qm
end
figure(2)
ezcontourf(W)
colorbar
图2总是出问题,显示如下:
【??? Operands to the || and && operators must be convertible to logical scalar values.

Error in ==> specgraph.contourgroup.schema>LdoDirtyAction at 256
  refresh(h);

??? Error occurred while evaluating listener callback.】
回复
分享到:

使用道具 举报

 楼主| 发表于 2012-5-12 09:59 | 显示全部楼层
自己顶一下
 楼主| 发表于 2012-5-13 10:12 | 显示全部楼层
求高手支招
发表于 2012-5-14 01:29 | 显示全部楼层
试执行下, 我出现的报错与LZ不同!
我的matlab版本为R2009a, LZ的matlab版本为何?

还有感觉是虚数出问题, ezcontourf可以画虚数吗?
 楼主| 发表于 2012-5-16 17:57 | 显示全部楼层

我的版本是R14,关于ezcontour能不能画虚数,不太清楚,我新手,刚刚接触,还望元老指点
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-21 04:20 , Processed in 0.087662 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表