'' Attempted to access sorted_evalue(0); index must be a positive integer or logical. '' how to remove this??????
조회 수: 5 (최근 30일)
이전 댓글 표시
%calculate eigen vector & eigen value of cm = evector & evalue
evector = dfdb * rvector;
evalue = diag( rvalue );
%clear rvector rvalue
disp( 'Calculated Eigen Vectors & Eigen Values of CM' );
[sorted_evalue, index] = sort( evalue ); %sorted in acending order
sorted_evalue = flipud( sorted_evalue ); %rearranged in decending order
index = flipud( index ); %rearranged corresponding indies also
%Now rearrange eigenvectors in the order of rearranged eigen values
evector( :, 1:nof ) = evector ( :, index );
smallest_evalue = (1/100) * sorted_evalue(0); % to obtain the effective eigen values
for i = 1:nof
if (sorted_evalue(i) < smallest_evalue )
break;
end
evalue = [ ];
end
index = i+1;
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2016년 2월 24일
The error is du to sorted_evalue(0). In Matlab the indices begin at 1, the 0 is not allowed
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Array Geometries and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!