Could anyone please help me to write the matlab code with bit explanation. Thanks in advance.
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
I have below data set. I want to take data set (L and W) when only N2 is integer. Other data of L and W will be deleted.
N1 =8.0000   10.0000   12.0000   14.0000   16.0000   18.0000   20.0000   22.0000   24.0000   26.0000   28.0000   30.0000
N2 =20.0000   16.0000   13.3333   11.4286   10.0000    8.8889    8.0000    7.2727    6.6667    6.1538    5.7143    
L = 0.3200    0.4000    0.4800    0.5600    0.6400    0.7200    0.8000    0.8800    0.9600    1.0400    1.1200      
W =0.8000    0.6400    0.5333    0.4571    0.4000    0.3556    0.3200    0.2909    0.2667    0.2462    0.2286
댓글 수: 0
채택된 답변
  KSSV
      
      
 2017년 2월 14일
        clc; clear all ;
N1 =[8.0000 10.0000 12.0000 14.0000 16.0000 18.0000 20.0000 22.0000 24.0000 26.0000 28.0000 30.0000] ;
N2 =[20.0000 16.0000 13.3333 11.4286 10.0000 8.8889 8.0000 7.2727 6.6667 6.1538 5.7143] ;
L = [0.3200 0.4000 0.4800 0.5600 0.6400 0.7200 0.8000 0.8800 0.9600 1.0400 1.1200] ;
W =[0.8000 0.6400 0.5333 0.4571 0.4000 0.3556 0.3200 0.2909 0.2667 0.2462 0.2286];
% get integers in N2
idx = find(mod(N2,1)==0);
% pick L and W when N2 is integer 
L1 = L(idx) ;
W1 = W(idx) ;
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!