Can You Nest If Statements in MATLAB?

  • Context: MATLAB 
  • Thread starter Thread starter SherlockOhms
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 6K views
SherlockOhms
Messages
309
Reaction score
0
Just started a new college module and we'll be using MATLAB quite a bit. I was wondering, can you nest if statements in MATLAB like in C#?
Would code such as this work in MATLAB?

if (condition 1)
if (sub condition 1)
Code
elseif (sub condition 2)
Code
elseif (condition 2)
if (sub condition 3)
Code
elseif (sub condition 4)
Code
end
 
Physics news on Phys.org