Thank you.
I have successfully solved Ms, but the thing is I have to obtain Mr as well.

I have used the exact same formula that you have provided to me,
x1 = linspace(1,14,1000);
P3G = 3; %initial guess
gamma = 1.4;
S = arrayfun(@(X) fzero(@(p3) p3*(1 -((gamma-1)*(p3-1))./sqrt(2*gamma*(2*gamma+(gamma+1)*(p3-1)))).^(-2.*gamma./(gamma-1)) - X, P3G), x1);
Ms = (((gamma+1)/(2.*gamma))*(S-1)+1).^0.5;
% So far, it is good. I gain S and Ms Matrix.
% But, I need to plug in Ms array to gain Mr.
S1 = arrayfun(@(X) fzero(@(Mr) ((Ms.*(Mr.^2-1))/(Ms.^2-1))*((1+((2.*(gamma-1)*(Ms.^2-1)))./(gamma+1)^2).*(gamma+1./Ms.^2)).^.5 - Mr - X, P3G), Ms);
...
it gives me "Operands to the || and && operators must be convertible to logical scalar values".
%I am trying to find Mr arrays with respect to Ms.

