how to find the position in an array

2 次查看(过去 30 天)
i got x=[1 0 1 1] and i need to save the position of all the variables in a array p=[1 2 3 4]; which refers x(1)=1x(2)=2.... and r=[30 24 25 30] value generated . from this r it is evident that r(1) and r(4) have the same values. i need to chk the matrix=[ 0 0 0 0 ; 0 0 1 0; 0 1 0 0; 0 0 0 0 ]; from this matrix generated i need to chk the row(1) &column(1) if that values are all 0 then i will from winner subset saving the w=[1]; simularly for the remaining cases
  1 个评论
Jan
Jan 2012-2-16
You forgot to ask a question.
It is not clear how x, p, r and the matrix are connected. And what is w? I suggest to explain the problem with more details and a small example. You can post the code, you have created so far and explain the occurring problems.

请先登录,再进行评论。

回答(0 个)

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by