matlab a a graph plot

1 次查看(过去 30 天)
NAS
NAS 2020-6-2
编辑: NAS 2020-9-26
as

采纳的回答

KSSV
KSSV 2020-6-2
%wava tank problem
clc; %clear workspace command window
%input
a=0.5;
rho=1030;
g=9.81;
l=30;
L=5.216;
d=2;
T=2;
w=2*pi/T;
k=2*pi/L;
Nx=80;
Nz=80;
Nt=5;
Lx=30;
Lt=4;
%end
x=linspace(0,L,Nx); %mesh
z=linspace(0,-d,Nz); %mesh
t=linspace(0,Lt,Nt); %mesh
[X,Y] = meshgrid(x,z) ;
dphix = zeros(size(X)) ;
dphiy = zeros(size(Y)) ;
for i = 1:length(t)
dphix = a*w/k*exp(k*Y).*cos(k*X-w*t(i)) ;
dphiy = a*w*exp(k*Y).*sin(k*X-w*t(i)) ;
quiver(X,Y,dphix,dphiy)
axis tight
drawnow
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by