Try this:
Sv = 1:0.1:2;
figure
hold all
for k = 1:numel(Sv)
fimplicit(@(x,y)f1(x,y,Sv(k)), [-2 2 -2 2]);
end
hold off
grid
function z = f1(x,y,S)
a=1;h=1;p=1;tau=0;m=10;
K1 = (x+h*y)/2;
K2 = (((x-h*y)/2).^2+(p*tau).^2).^(1/2);
c = 2-a;
z = a*(abs(K1+K2).^m) + a*(abs(K1-K2).^m) + c*((2*K2).^m) - 2*(S^m);
end
Note that it is necessary to remove the assigned value of ‘S’ inside ‘f1’, so the passed parameter is the value the function uses.
Best Answer