How to print several matrices with different dimensions from a single line of code?

5 views (last 30 days)
Input (randomly chosen):
A=ones(4);
B=magic(5);
C=hilb(6);
Is there an easy method to print all of the matrices from a single line of code (instead of leaving those semi colons off)? Please note that I do not want them manipulated and/or concatenated in any way.
Desired output for the above input is given here (obtained here, by leaving the semi colons off):

Accepted Answer

madhan ravi
madhan ravi on 4 Jul 2020
Edited: madhan ravi on 4 Jul 2020
ABC = {A, B, C};
[A, B, C] = ABC{:}
  3 Comments
Aryan Ritwajeet Jha
Aryan Ritwajeet Jha on 4 Jul 2020
Edited: Aryan Ritwajeet Jha on 4 Jul 2020
For (beginner) users with the same query, directly check out Stephen Cobeldick's comment. Thanks a lot Stephen!
I have accepted madhan ravi's answer, as technically, it did resolve my query. Thanks a lot madhan!

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!