How to divide this array problem ?

1 次查看(过去 30 天)
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 ,,,

采纳的回答

monika shivhare
monika shivhare 2018-6-7
data = [6 7 5 3 4 1 2];
dataA =[data(1) data(2:2:end)];
dataB =[data(1:2:end)];
  2 个评论
Muhammad Hafiz
Muhammad Hafiz 2018-6-7
编辑:Muhammad Hafiz 2018-6-7
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]
monika shivhare
monika shivhare 2018-6-7
编辑:monika shivhare 2018-6-7
dataA=dataA(2:end);
dataB=dataB(2:end);
alternatively, use
dataA(1)=[];
dataB(1)=[];

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Earth, Ocean, and Atmospheric Sciences 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by