To Find one element in a matrix or a Vector

3 次查看(过去 30 天)
How can I know whether 0 is an element of a Vector or a Matrix
Thank you

采纳的回答

Jan
Jan 2018-3-21
编辑:Jan 2018-3-21
containsZero = ~all(V(:))
This avoids to create the temporary array V(:)==0 and for large arrays this should be a measurable advantage.

更多回答(1 个)

Stephen23
Stephen23 2018-3-21

类别

Help CenterFile Exchange 中查找有关 Language Fundamentals 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by