MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by mohamed
on 4 Apr 2013

%water saturation calculation Q=input('porosity of formation='); Rw=input('water resistivity='); Rt=input('true resistivity='); x=input('type of formation='); if x==sandformation f=.62/Q^2.15; elseif x==compactedformation f=1/Q^2; elseif x==chalkyformation f=1/Q^2.2; end Ro=f*Rw; s=sqrt(Ro/Rw); sw=s*100; disp(sw);

*No products are associated with this question.*

Answer by Andrei Bobrov
on 4 Apr 2013

Accepted answer

x=input('type of formation=','s'); switch x case 'sandformation' f=.62/Q^2.15; case 'compactedformation' f=1/Q^2; otherwise % or case 'chalkyformation' f=1/Q^2.2; end

mohamed
on 4 Apr 2013

thank you it works correctly now, but i want to know the function of 's' inside the input function

## 0 Comments