How to delete the nth element from all the variables in my workspace?

1 次查看(过去 30 天)
Hello
I would like to delete the nth element from all the variables in my workspace, which are all vectors of the same size. I tried playing with the "who" function but it didn't work, any ideas?
Many thanks in advance

采纳的回答

Thorsten
Thorsten 2015-10-21
编辑:Thorsten 2015-10-21
x = whos;
n = 2;
for i=1:numel(x)
eval([x(i).name '(' int2str(n) ')=[];'])
end
  4 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by