开发者

MATLAB: how do I return entries in a vector?

开发者 https://www.devze.com 2023-02-10 12:08 出处:网络
Let\'s say a=[5;4;3;2;1] an开发者_JS百科d I want all entries > 3, so I want it to spit out v=[5,4].

Let's say a=[5;4;3;2;1] an开发者_JS百科d I want all entries > 3, so I want it to spit out v=[5,4].

I know "find" only finds the indices, so it doesn't exactly work.

any suggestions?


Include the inequality test in the index:

v = a(a>3)
0

精彩评论

暂无评论...
验证码 换一张
取 消