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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by