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

本文介绍了如何在Matlab中处理矩阵运算,包括变元素和变列向量的操作,以及使用surf函数创建3D表面图。同时展示了如何通过table结构来组织和比较迭代次数和函数计数的数据。

矩阵变元素,变列向量

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'})

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值