the problem of using 'case'
이전 댓글 표시
i want to use a loop of omega and when the omega has diffreent value ,the m0,m1,m2...have the different value,so in the loop i use the 'case' as this
for omega=0.1:0.1:2;
switch omega
case 0.100000;
m0=0.031949;
m1=3.141268;
m2=6.283023;
m3=9.424670;
m4=12.566289;
m5=15.707898;
m6=18.849502;
m7=21.991102;
m8=25.132701;
m9=28.274298;
m10=31.415894;
case 0.200000;
m0=0.063931;
m1=3.140293;
m2=6.282536;
m3=9.424345;
m4=12.566046;
m5=15.707703;
m6=18.849339;
m7=21.990963;
m8=25.132579;
m9=28.274190;
m10=31.415797;
and there are still some codes,but in the result,when omega=0.2,it still use the m0,m1,m2...of case 0.100000;
so when i change it as
case abs(omega-0.200000)<0.01;
it still has the problem,and why,thanks a lot!!!
댓글 수: 1
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 PDE Solvers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!