Can I optimize (using optimization tool box) few variables for a quantity extracted from a covariance matrix (Lyap function) numerically?
이전 댓글 표시
I know a bit about using optimization tool box for a symbolic function. But I want to use it for numercal values, if possible. For example, the stucture of my code is following:
fid = fopen(sprintf( 'test.dat'),'w' )
for a=0:1:10
for b=0:1:10
for c=0:1:10%optimizing this one
A=[....];matrix
B=[.....]; %matrix
V=Lyap(A,B);
v1=(V(1,1)+V(2,2)-1)/2;%somthing from V
.
.
v4=....
x0=[..]% storing
end %loop c
x=[x0;x];
m1=x(:,4);
[p, q]=max(a); %finding max
c0=x(q,1);%correspoding value of c for that max
v10=x(q,2);%correspoding value of v1 for that max
.
.
fprintf(fid,'%f %f %f %f'...., a, b, c0, v01..... )%writing to a file
end %loop b
end %loop a
fclose(fid); %close file
Now I want to use optimization tool as follow, if possible
function [ v1, v2, v3.....vn ]=myfn[a, b, c, V]
v1=(V(1,1)+V(2,2)-1)/2;
v2=....
v3=....
v4=....
end
then calling this function for optimization in main code.
Which optimization tool shall I use for such a numerical optimization?
Thanks a lot.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Computations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!