I was able to get the correct output which I wanted with the code written in Python.
However, I have no idea how to write it in MATLAB after the follwoing scripts.
MATLAB code
outliers = [1,3,7]; %outliers are indices numbers to delete
elm = [1, 2, 3, 4, 5, 6, 7, 8, 9];%preferred output
[1, 3, 5, 6, 7, 9]
Python code
outliers = [1,3,7]elm = [1, 2, 3, 4, 5, 6, 7, 8, 9]for i in range(len(outliers)-1, -1, -1): elm.pop(outliers[i])print(elm)
Best Answer