Can I optimize (using optimization tool box) few variables for a quantity extracted from a covariance matrix (Lyap function) numerically?
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Optimization Toolbox 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!