How to divide this array problem ?

for example :
data = [6
7
5
3
4
1
2]
dataA = [6 7 3 1]
dataB = [6 5 4 2]
please I little bit confuse about this ,,,

 采纳的回答

data = [6 7 5 3 4 1 2];
dataA =[data(1) data(2:2:end)];
dataB =[data(1:2:end)];

2 个评论

thanks monica you help me ,,,
after dataA and dataB get the array ,,
how to remove, for example: dataA = [6 7 3 1] dataB = [6 5 4 2]
to
dataA = [7 3 1] dataB = [5 4 2]
dataA=dataA(2:end);
dataB=dataB(2:end);
alternatively, use
dataA(1)=[];
dataB(1)=[];

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Language Fundamentals 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by