我是靠谱客的博主 狂野水杯,这篇文章主要介绍【MATLAB基础】—错误使用 mesh (line 75),现在分享给大家,希望可以做个参考。

1、问题

这个代码本来是只有二维图,想用mesh生成一个三维图,请问该如何修改?
加了mesh总是报错
错误使用 mesh (line 75)
Z 必须为矩阵,不能是标量或矢量。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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(

最后

以上就是狂野水杯最近收集整理的关于【MATLAB基础】—错误使用 mesh (line 75)的全部内容,更多相关【MATLAB基础】—错误使用内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(50)

评论列表共有 0 条评论

立即
投稿
返回
顶部