How to Suppress Output in MATLAB Using eval()?

  • Context: MATLAB 
  • Thread starter Thread starter matematikawan
  • Start date Start date
  • Tags Tags
    Matlab Output
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 4K views
matematikawan
Messages
336
Reaction score
0
I get this example from >>help eval
and add a semicolon.for n = 1:12
eval(['M' num2str(n) ' = magic(n)']);
end

The above commands display all 12 magic square. How do I suppress the output? I only want MATLAB to assign the variables not display them.
 
Last edited:
Physics news on Phys.org