Asked by sermet
on 15 May 2013

for example, a=[1 2 3;4 5 6;7 8 9] is a matrix.

I wanna put this matrix into the listbox as a 3x3 matrix form

*No products are associated with this question.*

Answer by Azzi Abdelmalek
on 15 May 2013

Accepted answer

a=[1 2 3;4 5 6;7 8 9] set(handles.listbox1,'String',num2str(a))

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 2 Comments

## Jan Simon (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/75855#comment_149087

What is a "3x3 matrix form" exactly? Even if you use the standard formatting e.g. by

evalc(disp(a)), the proportional font in the listbox might change the column orientation. The using a monospaced font in the uicontrol is required also.## Walter Roberson (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/75855#comment_149096

How many listbox entries are to be constructed from this? Is it intended that the matrix all go into a single entry?