Mira, if you try to make this function that way it does not work, all because the parameters yo use in this function at the end always change, try this: you already create the function like this:
function s=spolekonstant2(F_n, F_p, F_m, str)
%Formula to find coil constant
%inputs
% F_n is baseline
% F_m is negativ
% str is I, in ampere
% output
% s= coil constant
s = sqrt(((F_p)^2+(F_m)^(2)-2*(F_n)^2)/2*(str)^2);
end
So, the only thing you need to do is call the function and fill with the parameters you need,
F_p = 47.925;
F_m = 60.086;
F_n = 50.163;
str=89;
Result=spolekonstant2(F_n,F_p,F_m,str) %this is the way you call the function