Could anyone please help me to write the matlab code with bit explanation. Thanks in advance.

1 回表示 (過去 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

採用された回答

KSSV
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 ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by