Is this code(in mat lab function block) correct for the attached logic?
    조회 수: 2 (최근 30일)
  
       이전 댓글 표시
    
[~,k2]=sort(g,'ascend');
[~,k1]=sort(h,'ascend');
k3=k1+k2;
k=k3/2;
[~,fx_opt]=min(k);
댓글 수: 1
  Asvin Kumar
    
 2019년 12월 26일
				Looks good. 
Please note that MATLAB uses 1-based indexing while you require 0-based indexing. However, this won't affect the output of fx_opt because all values are off-shifted by 1.
답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
			
	제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

