lud = (get(handles.input1, 'String'));
s = str2num(lud);
[L,U,P] = lu(s);
t=num2str([U]);
set(handles.input2, 'string', [t]);
fh = figure();
tbh = uicontrol(fh, 'Style','edit','Units','Normalize',...
'Position',[.1 .1 .5 .2],'Max',2,'FontName', 'Consolas');
value = [randi(15,1,4); rand(2,4).*100];
vc = sprintfc('%g',value);
nchar = cellfun(@numel, vc);
vcPad = cellfun(@(c,n){[c,repmat(' ',1,n)]},vc,num2cell(max(nchar(:))-nchar));
rowsJoined = arrayfun(@(row){strjoin(vcPad(row,:),' ')}, 1:size(vcPad,1));
charPad = vertcat(rowsJoined{:});
tbh.String = (charPad);
4 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_802698
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_802698
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_803092
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_803092
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_803098
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_803098
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_803107
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/507732-how-to-align-matrices-in-a-static-text-box#comment_803107
サインインしてコメントする。