fork download
  1. f = ... % assign anonymous function to function handle for easier execution
  2. @(A){A(a=A>72),A(~a)}
  3.  
  4. s1 = ["L","D","L","D","D"]
  5. f(s1)
  6. disp('')
  7.  
  8. s2 = ["L","L","L"]
  9. f(s2)
  10. disp('')
  11.  
  12. s3 = ["D","D"]
  13. f(s3)
  14. disp('')
  15.  
  16. s4 = []
  17. f(s4)
  18. disp('')
  19.  
  20.  
Success #stdin #stdout 0.29s 403520KB
stdin
Standard input is empty
stdout
f =

@(A) {A(a = A > 72), A(!a)}

s1 = LDLDD
ans = 
{
  [1,1] = LL
  [1,2] = DDD
}

s2 = LLL
ans = 
{
  [1,1] = LLL
  [1,2] = 
}

s3 = DD
ans = 
{
  [1,1] = 
  [1,2] = DD
}

s4 = [](0x0)
ans = 
{
  [1,1] = [](0x0)
  [1,2] = [](0x0)
}