I am a beginner in Mathematica. How can I turn the following Matlab commands into Mathematica commands.
a=1;
b=2;
c=3;
d=4;
if ((a<4 || b>5) && ((c==3 || d<=6) && (c+d<10)))
a=10;
b=20;
c=30;
d=40;
elseif ((a<=2) && (c==3 || d<=6))
a=100;
b=200;
c=300;
d=400;
else
a=1000;
b=2000;
c=3000;
d=4000;
end
Which. – Kuba Jul 26 '16 at 17:36Whichin your notebook, then pressF1. – Kuba Jul 26 '16 at 17:46elsedoesn't return more either. You are making assignments there, do the same inWhich. – Kuba Jul 26 '16 at 17:55CompoundExpression);Which[x > 0, a = 1; b = 2;, x < 0, a = 3; b = 4;, True, a = b = 0]. – J. M.'s missing motivation Jul 26 '16 at 17:55