Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2009-10-05, 12:55   #1
huanxiong4903
初级会员
 
注册日期: 2009-10-05
帖子: 2
声望力: 0
huanxiong4903 正向着好的方向发展
默认 新手问一个基础问题

在学习别人的代码的时候看到这样一行

a2=not(a1);

a1是grey scale的图像

根据编者的意思,想通过a2=not(a1);这个操作,得到a2,且a2是一个binary image

可是我在逐步测试中,发现a2=not(a1)
得到的结果全部都是 0

后续的所有针对a2的操作都没有意义了

请问这个到底应该怎样正确理解。

谢谢
huanxiong4903 当前离线   回复时引用此帖
旧 2009-10-05, 14:20   #2
huanxiong4903
初级会员
 
注册日期: 2009-10-05
帖子: 2
声望力: 0
huanxiong4903 正向着好的方向发展
默认 回复: 新手问一个基础问题

以解决。
not -
Find logical NOT of array or scalar input
Syntax
~A
not(A)


Description
~A performs a logical NOT of input array A, and returns an array containing elements set to either logical 1 (true) or logical 0 (false). An element of the output array is set to 1 if the input array contains a zero value element at that same array location. Otherwise, that element is set to 0.

The input of the expression can be an array or can be a scalar value. If the input is an array, then the output is an array of the same dimensions. If the input is scalar, then the output is scalar.

not(A) is called for the syntax ~A when A is an object.
huanxiong4903 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 10:52


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