Write a Matlab program which gives the same output as the following program but only contains if statements

a = rand
if a < .3
’a < .3’
elseif a<.6
’.3 <= a <.6’
else
’a > 6’
end;

2 Comments

if (you show some effort)
if (you post some code)
we might help you with some hints
end
end
Why would you want to do that (unless it's a homework assignment in which case we've got to see an attempt first....)???

Sign in to comment.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 4 Jul 2015

Commented:

dpb
on 4 Jul 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!