I have two one-dimensional arrays, R and C. R is the row numbers and C is the column numbers. I need to get a subarray from an array A such that the new array does NOT contain certain rows and columns in A based on R and C.
To illustrate:
A = randn(5, 5)
R = [2, 3]
C = [4, 5]
I want to get an array by eliminating the 4th and 5th columns in A and also the 2nd and 3rd rows in A. What is a good way to do that?
It’s nice syntax, but won’t that only work for eliminating a single row or column? Maybe I’m just not seeing what you’re implying, but the simplest generalization I can see off the top of my head is a loop over in.