How to divide the input data for two levels in matlab
1 view (last 30 days)
Show older comments
L= 2; % L is no. of levels
L_total= 400;
[temp, alpha] = sort(rand(1,L_total)); %Howto divide this data into half for giving to two levels
Accepted Answer
Alex Mcaulley
on 21 Feb 2019
Edited: madhan ravi
on 22 Feb 2019
I don't know if I have understood your question, but this code split your variable in two:
a = temp(1:ceil(L_total/2));
b = temp(ceil(L_total/2)+1:end);
You can also use splitapply function
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!