Conditionals: IF statement examples

MATLAB programming related topics
Post Reply
User avatar
amh
Site Admin
Posts: 263
Joined: Thu Jan 06, 2022 12:35 am

Conditionals: IF statement examples

Post by amh »

IF statement example in MATLAB.

if the Z value negative, it will display negative, vice versa in positive case.

Code: Select all

z = -10;
if (z < 0)
disp('negative');
else
disp('positive');
end
Post Reply