How to remove column with 0 in matrix?

1 vue (au cours des 30 derniers jours)
Joshua Chhour
Joshua Chhour le 6 Juin 2023
Commenté : KSSV le 6 Juin 2023
I have a 0x100x150 double, but how do I get rid of the zero, so it becomes 100x150?
  1 commentaire
KSSV
KSSV le 6 Juin 2023
Is it 0? Or 1?

Connectez-vous pour commenter.

Réponse acceptée

rakshit gupta
rakshit gupta le 6 Juin 2023
You can use the squeeze() function in MATLAB to remove dimensions with size 1 in a multidimensional array.
The following code will give you, which is a 100x150 array but with same data as A.
You can also refer to Squeeze for more information.
% assuming your 0x100x150 double is named A
B = squeeze(A); % remove dimensions with size 1

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by