Minimalizing a function of two variables
Ältere Kommentare anzeigen
Hopefully my final question for a while.
I have my final function
FullScore(P1,P2)
This takes in experimental data, and works out the mean difference between this and data that is produced using P1 and P2. Origionally i was going to try use lsqcurvefit/lsqnonlin but because of my previous question my experimental data and simulated data are both used to produce the Y values on their respecive graphs.
My goal is to find the values of P1 and P2 that produce data that is the most similar to my experimental data
i am now simply trying
fminsearch(FullScore,[15 0.5]) %P1 goes from 0-35 and P2 0.01-1
When i run the function on its own it works fine, but when i run it from above it doesnt read 15 as P1 and 0.5 as P2 as the fire time these come up in the code i get(this is basically the first line of the code)
Not enough input arguments.
Error in FullScore (line 15)
newtext = [text1, num2str(P1), 'p ', num2str(P2), text2] ;
How can i make it so that my function takes in my two startin guesses correctly?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Vehicle Scenarios finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!