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

1 view (last 30 days)
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

Answers (1)

KSSV
KSSV on 29 Jul 2019
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)]

Categories

Find more on Mathematics and Optimization in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!