Effacer les filtres
Effacer les filtres

Removing empty cell in array

3 vues (au cours des 30 derniers jours)
Thulasi Durai Durai Samy
Thulasi Durai Durai Samy le 6 Juin 2012
Hello I have the following data
Mat=
[1] 'GFRP' [0] [0]
[2] 'GFRP' [0] [0]
[3] 'GFRP' [0] [0]
[4] 'GFRP' [0] [0]
[5] 'GFRP' [0] [0]
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
Finally I want
[1] 'GFRP' [0] [0]
[2] 'GFRP' [0] [0]
[3] 'GFRP' [0] [0]
[4] 'GFRP' [0] [0]
[5] 'GFRP' [0] [0]
Can some body help me.

Réponse acceptée

Thomas
Thomas le 6 Juin 2012
Probably there is an easier way..
Mat=Mat(~cellfun('isempty',Mat));
Mat=reshape(Mat,[],4)
  1 commentaire
Thulasi Durai Durai Samy
Thulasi Durai Durai Samy le 6 Juin 2012
Thanks it works well.
I have a three dimensional matrix in which case
Laminate_data(:,:,1) =
[1] 'GFRP' [0] [0]
[2] 'GFRP' [0] [0]
[3] 'GFRP' [0] [0]
[4] 'GFRP' [0] [0]
[5] 'GFRP' [0] [0]
[6] 'GFRP' [0] [0]
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []
How to trim this data by avoiding dummy space , I tried, can you help me .

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by