I apologise for being direct, but you have multiple errors.
First, you need to test ‘result’ to see if it contains the string 'series' or 'parallel'.
Second, your formulae for the total resistance of series or parallel is reversed.
See if this works:
result = 'series'; % Create Data
if strcmpi(result,'series')
RT = R1+R2;
elseif strcmpi(result,'parallel')
RT = R1*R2/(R1+R2);
end
where ‘RT’ is the total resistance of the network.