MATLAB: How to show rows and columns from a matrix in a edit texted in MATLAB

matlab gui

Hello everyone,
I'm still working on my project and I'm stuck again, please someone if could help me with thiss problem…
I want to show a matrix that contains a lot of columns and rows in a GUI and I don't know how to arrange that.
This is the matrix in the comand window: https://imgur.com/a/NeAYzXW
And this is how its show me in the interface: https://imgur.com/a/BR7aoSH
And this is the code:
MAIN PROGRAM:
s3 = ['[',regexprep(num2str(Vc),' +',' '),']'];
interfVc(s3);
INTERFACE PROGRAM:
function interfVc(s3)
%Manipularea figurii
figure('Name','CODARE/DECODARE TORNADO',...
'Units','normalized',...
'Color','white',...
'Position',[0.1,0.1,0.8,0.8]);
%'Elementele matricii de codare liniara Tornado [Vc]'
uicontrol('Style','Text',...
'Units','Normalized',...
'Position',[0.11,0.9,0.35,0.06],...
'BackgroundColor',[1,1,1],...
'FontSize',12,...
'FontWeight','b',...
'String','Elementele matricii de codare liniara Tornado [Vc]');
uicontrol('Style','Edit',...
'Units','Normalized',...
'Position',[0.11,0.4,0.7,0.5],...
'FontSize',10,...
'String',s3,...
'Callback','Vc=str2num(get(gco,''String''));interfVc(s3)');
Thank you.

Best Answer

Your matrix does not contains many rows. In fact, it's a row vector so it only contains 1 row. You can see this in your first image. Also this line would break if Vc had multiple rows: s3 = ['[',regexprep(num2str(Vc),' +',' '),']'];
So, the row vector is appearing correctly. If you'd like to reshape the vector into a matrix, please describe those intentions.