use of dynamic field within fitness function using GA from optimtool
Show older comments
My GA problem exists in estimating filter parameters, which I can resolve just fine using GA for one patient and one trial.
What I want to do : Create a batch to run this several times (x amount of trials) for each specific patient (note: I am currently not looking for an additive/nested GA which would give me a global solution. I just want to execute the GA on individual data without having to manually enter the command for each file and adapting the fitness function. [schematic representation] for i=1:subjects for j=1:trials [x,fval]=GA_from_optimtools_related_to_fitnesFc(...) ....
My question: In my current GA fitness function I am loading the data file
function [TRE] = fit_test(filter_param)
% entry data
fs=1000;
cd G:\data\folder\patient\condition_1\Upsampled\
load('data.mat')
...
I am looking for a way to place this outside of the fitness function so that I can loop it (execute the GA for all the trials of each patient; remember I am not looking for one global solution, I want to obtain the optimized parameters for each separate trial). I have tried creating a variable (containing the folder and file name)and making it global, to then load it from within the fitness function -> but failed to do this on the compiled GA.
Can anyone please give me some pointers or point me towards some documentation clarifying this issue?
Accepted Answer
More Answers (0)
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!