设为首页收藏本站

EPS数据狗论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1890|回复: 3

MATLAB函数文档

  [复制链接]

10

主题

111

金钱

170

积分

入门用户

发表于 2018-9-30 14:16:12 | 显示全部楼层 |阅读模式
Logical Operators: Short-Circuit && ||
Logical operations with short-circuiting
Syntax
expr1 && expr2
expr1 || expr2
Description
expr1 && expr2 represents a logical AND operation that employs short-circuiting
behavior on page 1-4. That is, expr2 is not evaluated if expr1 is logical 0 (false).
Each expression must evaluate to a scalar logical result.
expr1 || expr2 represents a logical OR operation that employs short-circuiting
behavior on page 1-4. That is, expr2 is not evaluated if expr1 is logical 1 (true). Each
expression must evaluate to a scalar logical result.
Examples
Use Scalar Logical Conditions
Create two vectors.
X = [1 0 0 1 1];
Y = [0 0 0 0 0];
Using the short-circuit OR operator with X and Y returns an error. The short-circuit
operators operate only with scalar logical conditions.
Use the any and all functions to reduce each vector to a single logical condition.
any(X) || any(Y)
ans = logical
1
The expression is equivalent to 1 OR 0, so it evaluates to logical 1 (true) after
computing only the first condition, any(X).

MATLAB Function Reference.pdf

72.94 MB, 下载次数: 0, 下载积分: 贡献 -1

售价: 1 金钱  [记录]  [购买]

351

主题

2万

金钱

3万

积分

版主

QQ
发表于 2018-10-1 00:03:58 | 显示全部楼层
想看,谢谢分享
dog rich, don't forget
回复 支持 反对

使用道具 举报

0

主题

2407

金钱

3700

积分

中级用户

发表于 2018-10-1 09:59:02 | 显示全部楼层
谢谢楼主的分享
回复 支持 反对

使用道具 举报

351

主题

2万

金钱

3万

积分

版主

QQ
发表于 2018-10-2 08:46:33 | 显示全部楼层

谢谢楼主的分享
dog rich, don't forget
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

客服中心
关闭
在线时间:
周一~周五
8:30-17:30
QQ群:
653541906
联系电话:
010-85786021-8017
在线咨询
客服中心

意见反馈|网站地图|手机版|小黑屋|EPS数据狗论坛 ( 京ICP备09019565号-3 )   

Powered by BFIT! X3.4

© 2008-2028 BFIT Inc.

快速回复 返回顶部 返回列表