How to remove the last element from an array of cells in Matlab?
The documented method does not work:
>> A = {'a', 'b', 'c'} A = 1×3 cell array 'a' 'b' 'c' >> A{end}=[] A = 1×3 cell array 'a' 'b' []
I need an array to become 1x2.
1x2
You should use parentheses instead of curly braces (which act on the internal values of the cell, not on the cells themselves):
A(end) = [];
For details, see the last section of the official documentation that you indicated:
https://mathworks.com/help/matlab/matlab_prog/delete-data-from-a-cell-array.html
Source: https://habr.com/ru/post/1692688/More articles:MONGODBView Cropped 1080 x 1920 phones - androidrepeating a list containing duplicate values - pythonwhy blas is slower than numpy - c ++Lint considers Kotlin MutableMap.forEach () to be java.util.Map.forEach () - javasize folder for different screen sizes - androidФункции расширения Котлина внезапно требуют уровня api 24 - androidHow do common Java methods work under the hood? - javaObject descent with object arrays - javascriptHow to aggregate in one field: the value specified in the request in elasticsearch - elasticsearchAll Articles