convert codes into matlab R2015b

close all; clear; clc;
%menentukan opsi optimisasi
options = optimoptions(@fminunc,'Display','iter','Algorithm','quasi-newton');
%menentukan guess value
xy_guess = [0,0];
%memanggil algoritma optimisasi
[xy_opt, fval] = fminunc(@rosenbrock_func,xy_guess,options)
%fungsi objektif
function f = rosenbrock_func(in);
x = in(1);
y = in(2);
f = 100*(y-x^2)^2 + (1-x))^2
end
how can i convert this code into matlab R2015b?

댓글 수: 3

Sriram Tadavarty
Sriram Tadavarty 2020년 3월 22일
May i know what do you indicate the conversion of this code to R2015b? Just use the code in that MATLAB, provided all the functions are available in that version. Then, it should work.
risky amalia
risky amalia 2020년 3월 22일
For example fminunc in that code, there's fminunc too in matlab R2015b buat it doesn't work. Or i have made mistake? And then rosenbrock function. I don't know what it calls in matlab R2015b
dpb
dpb 2020년 3월 22일
What does "it doesn't work" mean, precisely? Show us...
Your code above includes the definition of rosenbrock_func. You must place that code in its m-file of that name in a location on your matlabpath; functions are not defined in the command wlndow inline.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Time Series Objects에 대해 자세히 알아보기

제품

릴리스

R2015b

태그

질문:

2020년 3월 22일

댓글:

dpb
2020년 3월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by