You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drops all of the singleton dimensions of `A` (dimensions that are 1).
320
+
If `A` contains only one element (i.e., all of its dimensions are singletons) then the output will be a zero-dimensional array.
321
+
322
+
If you know the dimension that you want to drop, use dropdims(A ; dims= dimensionsToRemove).
323
+
324
+
Only use this function if you don't know the dimensions that you want to remove, and you are sure that you are not removing important dimensions, and if you don't care about type stability.
325
+
326
+
Returns an array containing the same data as `A` but with no singleton dimensions; note that `arr` is NOT a copy of `A`, i.e., modifying the contents of `arr` will modify the contents of `A`. To get a copy use copy(arr).
327
+
328
+
# Examples
329
+
```julia
330
+
A1 = ones(2, 1, 2); # 3 dimensional
331
+
mSqueeze1 = squeezeM(A1) # [1 1; 1 1]
332
+
333
+
A2 = zeros(1, 4, 1);
334
+
A2[:, 1:4, ] = [5; 3; 6; 0]
335
+
mSqueeze2 = squeezeM(A2) # When it gets one dimensional, it is vertical.
0 commit comments