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

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -