Problem 1971. Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty. For example
A = 1:10
A(5) = []
results in
1 2 3 4 6 7 8 9 10
You task is to find the shortest, elegant, way in Matlab to do the same for cell arrays. Regexp, eval, and other workarounds that trick mtree are considered stupid, and will not be appreciated.
Solution Stats
Problem Comments
-
2 Comments
源樹 上林
on 22 Aug 2020
good
Yunpeng Teng
on 5 Dec 2020
you should add that the element is deleted by the index not the value
Solution Comments
Show commentsProblem Recent Solvers1726
Suggested Problems
-
Flag largest magnitude swings as they occur
679 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
481 Solvers
-
Try 1.5.4: Celsius to Fahrenheit
827 Solvers
-
Convert given decimal number to binary number.
2093 Solvers
-
1698 Solvers
More from this Author31
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!