fmincon help to finde a value for x that make the difference as close to zero as possible
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi i want the difference between F_experiment and F_numerisk be close to zero by using fmincon
function [J] = functest(x);
F_experiment =[1.2;1.8;2.2;2.8;3.2;3.8];
F_numerisk =[1.39200855109546;1.39281818487934;4.87073717626988;4.87384327614117;5.24597805869986;9.35466689738964;10.2424063575844;10.3088174008634;15.0587612254823;16.5529598630734;16.9515500154499;19.7694016673459;21.1084277255124;22.3051621717863;22.4078368670210;22.9697843089879;23.0231310886450;23.1898460773536]-x;
for i =1:length(F_numerisk)
f_afvigelse(i) = abs((F_experiment(i)-F_numerisk(i))/F_numerisk(i)) ; % procent afvigelse
end
f_afvi = sum(f_afvigelse) ;
J = f_afvi
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!