필터 지우기
필터 지우기

problem with Find function

조회 수: 1 (최근 30일)
safaa
safaa 2017년 4월 2일
편집: Stephen23 2017년 4월 2일
A=[ 5 0 2 5 1 0 1 1 2 2;
0 8 6 6 0 4 4 2 0 0;
7 9 9 7 4 8 10 6 4 7;
8 10 10 9 9 0 0 0 5 0]
if curr_site =2
adjesent=(A(:,curr_site));
it give me 0,8,9,10 and
adj=find(A(:,curr_site));
it give 1,2,3,4
fewestlinkadjesent=A(curr_site,adj);
it give 7 ,9,9,7 but it is wrong
I want it to return 2,3,4

답변 (1개)

Nicolaie Popescu-Bodorin
Nicolaie Popescu-Bodorin 2017년 4월 2일
is nothing wrong there! the code is working well! change the code accordingly to your intention!

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by