optimization for nonlinear equation using fminunc
조회 수: 1 (최근 30일)
이전 댓글 표시
i have an equation . i have to do optimization for this to get unknown parameters z a and b. , and are matrixes of size 364x441.after getting z a and b i have to put those values in above equation to get estimated LHS. how to do this using fminunc funtion in matlab
댓글 수: 0
채택된 답변
Torsten
2023년 7월 10일
편집: Torsten
2023년 7월 10일
x0 = [1 1 1];
fun = @(x) x(1)*dsdt + x(2)*s.^x(3);
f = @(x) sum(sum((fun(x) - p).^2));
x = fminsearch(f,x0)
lhs = fun(x)
댓글 수: 5
Torsten
2023년 7월 10일
편집: Torsten
2023년 7월 10일
s = load("s.mat");
s = s.s;
s = s(:);
size(s)
idx = s > 0;
s = s(idx);
size(s)
dsdt = load("dsdt.mat");
dsdt = dsdt.dsdt;
dsdt = dsdt(:);
dsdt = dsdt(idx);
p = load("p.mat");
p = p.p;
p = p(:);
p = p(idx);
x0 = [1 1 1];
fun = @(x) x(1)*dsdt + x(2)*s.^x(3);
f = @(x) sum((fun(x) - p).^2);
x = fminsearch(f,x0,optimset('MaxFunEvals',10000,'MaxIter',10000,'Display','iter'))
f(x)
lhs = fun(x)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!