(different_salts_available==1||2||3||4||5)
is bad syntax for if in MATLAB. It results in testing the result of the logical expression
(different_salts_available==1) || 2 || 3 || 4 || 5
which is always TRUE so nothing matters about what the variable value actually is.
MATLB requires the form as
if different_salts_available==1 || different_salts_available==2 || different_salts_available==3 ...
which is very verbose; you could write
if ismember(different_salts_available,1:5)
as one possible way or
if different_salts_available>=1 & different_salts_available<=5
or several other alternatives.
The latter is common enough expression I have a utility routine iswithin I use quite a bit to hide some higher level complexity
function flg=iswithin(x,lo,hi)
% returns T for values within range of input
% SYNTAX:
% [log] = iswithin(x,lo,hi)
% returns T for x between lo and hi values, inclusive
flg= (x>=lo) & (x<=hi);
end
With it, the latter above becomes
if iswithin(different_salts_available,1,5)
...