genetic algorithm solver with excel

Hello everyone, please help me
i want to do an optimization genetic algorithm with variables from excel.
how can i do that?
Thanks

回答(1 个)

For genetic algorithm, if you have the global optimization toolbox, then try ga(): https://www.mathworks.com/help/releases/R2020a/gads/ga.html
For a more specific suggestion, share the detail about your data and model.

5 个评论

hello sir, thanks for your answer
so i have this data from excel
and i want to do optimization with this 3 variable from column D,E,F with genetic algorithm
can you help me please?
Can you show the mathematical model you want to optimize?
To be more specific I want to optimize the membership function of fuzzy logic with genetic algorithms.
This is the code that i have made by using the data
function processbutton_Callback(hObject, eventdata, handles)
% hObject handle to processbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Beasiswa=newfis('Beasiswa');
Beasiswa=addvar(Beasiswa,'input','IPK',[3 4]);
Beasiswa=addmf(Beasiswa,'input',1,'Rendah','trimf',[3 3 3.4]);
Beasiswa=addmf(Beasiswa,'input',1,'Sedang','trimf',[3.2 3.5 3.8]);
Beasiswa=addmf(Beasiswa,'input',1,'Tinggi','trimf',[3.6 4 4]);
Beasiswa=addvar(Beasiswa,'input','skorperilaku',[0 10]);
Beasiswa=addmf(Beasiswa,'input',2,'Rendah','trimf',[0 0 4]);
Beasiswa=addmf(Beasiswa,'input',2,'Sedang','trimf',[3 5 7]);
Beasiswa=addmf(Beasiswa,'input',2,'Tinggi','trimf',[6 10 10]);
Beasiswa=addvar(Beasiswa,'input','gajibeban',[0 15000000]);
Beasiswa=addmf(Beasiswa,'input',3,'Rendah','trimf',[0 0 5000000]);
Beasiswa=addmf(Beasiswa,'input',3,'Sedang','trimf',[4000000 6000000 10000000]);
Beasiswa=addmf(Beasiswa,'input',3,'Tinggi','trimf',[9000000 15000000 21000000]);
Beasiswa=addvar(Beasiswa,'output','Kelayakan',[0 1]);
Beasiswa=addmf(Beasiswa,'output',1,'Rendah','trimf',[0 0 0.3]);
Beasiswa=addmf(Beasiswa,'output',1,'Sedang','trimf',[0.3 0.5 0.7]);
Beasiswa=addmf(Beasiswa,'output',1,'Tinggi','trimf',[0.7 1 1]);
rules = [1 1 1, 2 1 1
1 1 2 2 1 1
1 1 3 1 1 1
1 2 1 2 1 1
1 2 2 2 1 1
1 2 3 1 1 1
1 3 1 2 1 1
1 3 2 1 1 1
1 3 3 1 1 1
2 1 1 3 1 1
2 1 2 3 1 1
2 1 3 1 1 1
2 2 1 2 1 1
2 2 2 2 1 1
2 2 3 1 1 1
2 3 1 1 1 1
2 3 2 1 1 1
2 3 3 1 1 1
3 1 1 3 1 1
3 1 2 3 1 1
3 1 3 1 1 1
3 2 1 3 1 1
3 2 2 2 1 1
3 2 3 1 1 1
3 3 1 2 1 1
3 3 2 2 1 1
3 3 3 1 1 1];
Beasiswa = addrule(Beasiswa,rules);
fuzzy(Beasiswa)
global ipk
global skor
global gjbb
global nama
out = evalfis([ipk, skor, gjbb],Beasiswa)
tableData = [nama,ipk, skor,gjbb,out];
set(handles.uitable1,'data',tableData,'ColumnName',{'Nama';'IPK';'Skor_Perilaku';'Gaji_Beban';'Output'});
Can you show me a refrences like video, code or anything?
or if i'm wrong please correct
What is the optimization function or objective function here?
i want to make rank from fitness value
what do you suggest for me ?

请先登录,再进行评论。

类别

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by