How to solve a single equation with 2 variables? Both of which are integers.

1 次查看(过去 30 天)
D=4.4010;
rowS=0.8613;
Lx=0.286;
Lz=0.198;
fnm=[134 266 408 481 785 863];
wnm=2*pi.*fnm;
wnm=sqrt(D/rowS).*((m.*pi./Lx).^2+(n.*pi./Lz).^2);
need to find m & n

回答(1 个)

KSSV
KSSV 2019-7-29
D=4.4010;
rowS=0.8613;
Lx=0.286;
Lz=0.198;
fnm=[134 266 408 481 785 863];
wnm=2*pi.*fnm;
m = 1:10 ; n = 1:10 ;
[m,n] = meshgrid(m,n) ;
m = m(:) ; n = n(:) ;
wnm1=sqrt(D/rowS).*((m.*pi./Lx).^2+(n.*pi./Lz).^2);
idx = knnsearch(wnm1,wnm')
[m(idx) n(idx) wnm' wnm1(idx)]

类别

Help CenterFile Exchange 中查找有关 Oceanography and Hydrology 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by