How to get the index of new number in descending sequence vector

조회 수: 1 (최근 30일)
fyza affandi
fyza affandi 2018년 11월 17일
편집: madhan ravi 2018년 11월 17일
I have probability named A and B
A=[ 0.6 0.2 0.1 0.5 0.5]
B=[ 0.15]
Then the probabilty is arranged and named C
C=[0.6 0.2 0.15 0.1 0.5 0.5]
how can I get to know that probability B is at column 3?

채택된 답변

madhan ravi
madhan ravi 2018년 11월 17일
편집: madhan ravi 2018년 11월 17일
location=find(ismember(C,B))
Note: logical indexing is faster than find
  댓글 수: 2
fyza affandi
fyza affandi 2018년 11월 17일
Thank you. What is vector C havent created? How to add vector B into A and sort in descending order?
madhan ravi
madhan ravi 2018년 11월 17일
how can I get to know that probability B is at column 3?
Anytime :) ,The answer above is for this question

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by