Hi !
I am trying to creat a function that I can both use to pass values and compute the gradient of that function.
I tried both these :
but the for the first I cant pass values and the 2nd the gradient function in matlab does not work
syms x1 x2f= 100*(x2-x1^2)^2 + (1+x1)^2;gr= gradient(f)%%%%%% other way
syms x1 x2 f=@(x1,x2) 100*(x2-x1^2)^2 + (1+x1)^2;gr= gradient(f)
Best Answer