Error using plot Vectors must be the same length
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi, I am getting on error this graph plot. Please me
spf.rho=999.62; % kg/m^3, the density of water
spf.mu=1.0093e-3; % viscosity of water
betam=4.4e-10; % compressibility of water
lambda=0.14; % meters, wavelength of the device
rho_p=2650; % kg/m^3, the density of sand
betap=2.16e-10; % compressibility of PMMA
eta=8.94e-4; % viscosity of water
L=0.2; % length of the channel in the x direction
h=0.07; % width of the channel in the y direction
w=0.07; % channel height in the z direction
FontSizeAll=10; % font size for graphs
theta=-60*pi/180; % device tilt angle
N=2000; % number of grid steps
xs=-L/2:L/N:L/2;
ys=-h/2:h/N:h/2;
[x,y]=meshgrid(xs,ys);
dP=0.90; % pressure across the channel driving a flow averaging 2 mm/s
z=0; % midpoint of the channel in channel height.
% calculation of the velocity from profile
sumsection=0;
for n=(0:1:11)
sumsection=sumsection+(32*(1)^n*cosh(((2*n+1)*pi*z)/h).*cos(((2*n+1)*pi.*y)./h))/((2*n+1)^3*pi^3*cosh(((2*n+1)*pi*w)/(2*h))) ;
end
VW=((dP*h^2)/(8*spf.mu*L).*(1-(4.*y.^2./h^2)))-((dP*h^2)/(8*spf.mu*L)).*sumsection; % fluid velocity at each point in the cross section of the channel
P=(0:0.1e5:17e5); % Pa, range of acoustic pressures
R=[1:1:10].*1e-6; % meters, range of particle Radii
plot(VW,G);
Answers (1)
Mehmed Saad
on 15 Apr 2020
size(VW)
ans =
2001 2001
size(G)
ans =
171 10
You cant plot these two against each other
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!