Delete some columns from a cell array depending on an array SP

1 vue (au cours des 30 derniers jours)
luca
luca le 15 Oct 2019
Commenté : luca le 15 Oct 2019
Given the cell array
V={{[1,1,1,1;25,45,70,90],[2,2,2,2;78,112,146,180],[3,3,3,3;93,127,161,195],[4,4;70,100],[],[6;85],[],[],[9,9;85,110]},{[],[2,2,2,2;73,107,141,175],[3,3,3,3;83,117,151,185],[4,4,4,4;65,85,105,125],[],[6;85],[],[],[9,9,9;80,105,130]}};
and the array
SP= [1 2 3 4 6 9];
I want to remove from the cells V the column that are not in SP.so column 5 7 8. obtaining
V={{[1,1,1,1;25,45,70,90],[2,2,2,2;78,112,146,180],[3,3,3,3;93,127,161,195],[4,4;70,100],[6;85],[9,9;85,110]},{[],[2,2,2,2;73,107,141,175],[3,3,3,3;83,117,151,185],[4,4,4,4;65,85,105,125],[6;85],[9,9,9;80,105,130]}};
May someone help me?
  3 commentaires
Guillaume
Guillaume le 15 Oct 2019
Yes.
The [] around SP are pointless though.
luca
luca le 15 Oct 2019
Thanks!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by