I want to delete the elements that are larger than a certain value, then the next element will replace the deleted one(shift forward). For example,
[1 2 9;3 1 4;2 9 7]
, delete those larger than 4, the output will be
[1 2 3;1 4 2]
If the no. of elements is not the multiple of 3, the remaining ones will be deleted. Could anyone give me some ideas? Thanks everyone!
Best Answer