matrix - Complement subset in Matlab -


this question has answer here:

in r, can following:

v <- 11:20 v[-(4:5)] 

and 11 12 13 16 17 18 19 20, indices except 4th , 5th.

is there equivalent in matlab's indexing logic?

however wrap mind around it, not seem correct search terms google own result elementary question.


note: of course might use of set functions, e.g.

v = 11:20; v(setdiff(1:length(v), 4:5)) 

however, not intuitive.

an alternative remove elements array:

u = v; u(4:5) = []; 

i'm using temporary variable since don't know if it's acceptable modify original array v or not.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -