Need a piece of code to
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
How can I conver a n-by-n integer matrix generated in MATLAB like the below 3-by-3 matrix
A=[1 2 3
4 5 6
7 8 9];
to the form below:
B=[[1,2,3],[4,5,6], [7,8,9]]
Please help me on writing this for a n-by-n matrix.
0 Kommentare
Antworten (1)
madhan ravi
am 9 Jun. 2019
B = num2cell(A,2).'
5 Kommentare
madhan ravi
am 9 Jun. 2019
B=[[1,2,3],[4,5,6], [7,8,9]]
% copy it and paste it in MATLAB’s command window and see what happens , perhaps you are thinking of python’s list?
Siehe auch
Kategorien
Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!