目录
1、问题
这个代码本来是只有二维图,想用mesh生成一个三维图,请问该如何修改?
加了mesh总是报错
错误使用 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,:) &