MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   将所有非零矩阵元素设置为1(同时将其他元素保持为0) (https://www.labfans.com/bbs/showthread.php?t=26520)

poster 2019-12-14 20:13

将所有非零矩阵元素设置为1(同时将其他元素保持为0)
 
我有一个定义为的网格

[X, Y, Z] = meshgrid(-100:100, -100:100, 25); % z will have more values later 和两个形状(在这种情况下为椭圆形):

x_offset_1 = 40; x_offset_2 = -x_offset_1; o1 = ((X-x_offset_1).^2./(2*Z).^2+Y.^2./Z.^2


所有时间均为北京时间。现在的时间是 11:00

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.