Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
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

回答(1 个)

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

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by