matlab错误使用meshline47,求问这个代码如何解决错误使用 mesh (line 75) Z 必须为矩阵,不能是标量或矢量。?...

clc;

clear;

f = 750;%单频信号的频率

fsample = 50*f;%采样频率

dlts = 1/fsample;%采样周期

dd = 1;%阵元间距

cc=1500;%声速

dsita=2/360*pi;%扫描角度间隔

beam_no=2*pi/dsita;%波束个数

m=8;%阵元个数

dltc=cc*dlts;%一个采样周期声波传播的距离

t = 0.005:dlts:0.056;

n = length(t);

bn=round(dd/dltc);

ks=n-floor(m/2)*2*bn-1;

ss=zeros(beam_no,ks);

theta =45;

%单频信号

xx(1,:) = cos (2*pi*f.*t);

xx(2,:) = cos(2*pi*f.*(t - 3*dd*cos(theta*pi/180)/cc));

xx(3,:) = cos(2*pi*f.*(t + 3*dd*sin(theta*pi/180)/cc));

xx(4,:) = cos(2*pi*f.*(t + 3*dd*cos(theta*pi/180)/cc));

xx(5,:) = cos(2*pi*f.*(t - 3*dd*sin(theta*pi/180)/cc));

xx(6,:) = cos(2*pi*f.*(t - dd*cos(theta*pi/180)/cc));

xx(7,:) = cos(2*pi*f.*(t - 2*dd*cos(theta*pi/180)/cc));

xx(8,:) = cos(2*pi*f.*(t + dd*sin(theta*pi/180)/cc));

xx(9,:) = cos(2*pi*f.*(t + 2*dd*sin(theta*pi/180)/cc));

xx(10,:) = cos(2*pi*f.*(t + dd*cos(theta*pi/180)/cc));

xx(11,:) = cos(2*pi*f.*(t + 2*dd*cos(theta*pi/180)/cc));

xx(12,:) = cos(2*pi*f.*(t - dd*sin(theta*pi/180)/cc));

xx(13,:) = cos(2*pi*f.*(t - 2*dd*sin(theta*pi/180)/cc));

for i=1:beam_no

dltn(1)=0;

dltn(2)=round(3*dd*cos(dsita*(i-1))/dltc);

dltn(3)=round(-3*dd*sin(dsita*(i-1))/dltc);

dltn(4)=round(-3*dd*cos(dsita*(i-1))/dltc);

dltn(5)=round(3*dd*sin(dsita*(i-1))/dltc);

dltn(6)=round(dd*cos(dsita*(i-1))/dltc);

dltn(7)=round(2*dd*cos(dsita*(i-1))/dltc);

dltn(8)=round(-dd*sin(dsita*(i-1))/dltc);

dltn(9)=round(-2*dd*sin(dsita*(i-1))/dltc);

dltn(10)=round(-dd*cos(dsita*(i-1))/dltc);

dltn(11)=round(-2*dd*cos(dsita*(i-1))/dltc);

dltn(12)=round(dd*sin(dsita*(i-1))/dltc);

dltn(13)=round(2*dd*sin(dsita*(i-1))/dltc);

for j=1:13

ss(i,:)=ss(i,:)+xx(j,bn*floor(m/2)+1+dltn(j)+1:n-bn*floor(m/2)-1+dltn(j)+1);

end

end

peakx=zeros(1,beam_no);

for i=1:beam_no

peakx(i)=var(ss(i,:));

end

alpha = 0:1/180*pi:2*pi-1/180*pi;

polar(alpha,peakx);

figure,mesh(abs(peakx))

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值