MATLAB: While loop with if function

if statementwhile loop

Hi, need some help on whie loop and if function.
E.g,
Amount =$1-500
type = a or b
How should I write in mathlab, if I wan if the amount between 1-500 and if the type is "a" then show the 'a" result else showing "b" result. And after that will ask whether user want to continue the process or not.

Best Answer

if 1 <= amount & amount <= 500 & strcmp(type, 'a')