Info

This question is closed. Reopen it to edit or answer.

x is 521*1 vector.i wanna to access x values except the positions of 1:16:512.

1 view (last 30 days)
x=rand(512,1);
p=1:16:512;
disp(x(p)) % it displays 1 value,17 value like that
i want to display the remainig positions value

Answers (1)

the cyclist
the cyclist on 31 Dec 2017
Here is one way:
x=rand(512,1);
p=1:16:512;
q=setdiff(1:512,p);
disp(x(q))

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!