How to delete the nth element from all the variables in my workspace?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Victor Lejona
el 21 de Oct. de 2015
Comentada: Victor Lejona
el 21 de Oct. de 2015
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
0 comentarios
Respuesta aceptada
Thorsten
el 21 de Oct. de 2015
Editada: Thorsten
el 21 de Oct. de 2015
x = whos;
n = 2;
for i=1:numel(x)
eval([x(i).name '(' int2str(n) ')=[];'])
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!