MATLAB Answers

Is it possible to use element by element comparison between a single variable and individual matrix values?

조회 수: 2(최근 30일)
Clayton
Clayton 15 Oct 2014
답변: Iain 15 Oct 2014
Is it possible to use element by element comparison between a single variable and individual matrix values?

  댓글 수: 0

Sign in to comment.

답변(1개)

Iain
Iain 15 Oct 2014
Yes. Try these to see what makes sense for your little problem whatever it happens to be...
logical_cmp_result = eye(3) == 1
all(logical_cmp_result)
any(logical_cmp_result)
all(all(logical_cmp_result))
randomvals = rand(3,3);
logical_cmp_result = randomvals([1,3,5,7,9]) > 0.5 % This uses randomvals(1,1),(3,1),(2,2) (1,3) & (3,3)
logical_cmp_result = randomvals(eye(3) == 1) > 0.5

  댓글 수: 0

Sign in to comment.

태그


Translated by