自学内容网 自学内容网

code摘录日记[矩阵变元素,变列向量,3D表面图,table行列设置] Matlab

矩阵变元素,变列向量

W1(Z1 < Z2) = nan; % Z1,Z2 all matrix,Only plot points where Z1 > Z2;Z1 < Z2位置值填为NaN

x = x(:); % Now x is a 30-by-1 vector; matrix变列vector技巧

3D表面图

hand = figure; % Handle to the figure, for more plotting later
set(gcf,'Color','w') % White background
surf(X,Y,W1,'LineStyle','none'); %surf:3-D three-dimensional surface plot, which is a three-dimensional surface that has solid edge colors and solid face colors.
hold on
surf(X,Y,W2,'LineStyle','none');
view(-44,18) %方位角 仰角

table行列设置

tbl = table([output.iterations;output2.iterations],[output.funcCount;output2.funcCount],...
    'RowNames',{'With Derivatives','Without Derivatives'},'VariableNames',{'Iterations','Fevals'})

在这里插入图片描述


原文地址:https://blog.csdn.net/u012114900/article/details/136699891

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!