MATLAB: How to find the middle 25% of an array array Hello, I have an array X with N elements. Is there a way to obtain a new array Y which comprises the middle 25% of array X? Thanks for the help. Best Answer Try thisX = length(yourVector)index1 = round(vecLength * (0.5 - 0.25/2))index2 = round(vecLength * (0.5 + 0.25/2))Y = X(index1 : index2) Related SolutionsMATLAB: Comparing two separate for loops Use intersect():Z =[0.0024 0.0019 0.0015 0.0012 0.0010 0.0007 0.0005 0.0003 0.0002]Y =[0.0031 0.0024 0.0019 0.0015 0.0012 0.0010 0.0007 0.0005 0.0003 0.0002]X = intersect(Z, Y) MATLAB: Rounding elements in array to nearest 0.25 Hi,I think you are looking for:in = [1373.6981385.0241394.821400.4361396.532];%round upup = floor(in) + ceil( (in-floor(in))/0.25) * 0.25%round downdown = floor(in) + floor( (in-floor(in))/0.25) * 0.25 Related QuestionHow to obtain the threshold 25% of the gray intensitiesHow to separate signals with diffrent frequenciesIs MATLAB 7.3 (R2006) only able to use 25% of the CPUHow to make a code that will count the number of times the sign changes succesively through an array
Best Answer