Removing empty cell in array

3 次查看(过去 30 天)
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.

采纳的回答

Thomas
Thomas 2012-6-6
Probably there is an easier way..
Mat=Mat(~cellfun('isempty',Mat));
Mat=reshape(Mat,[],4)
  1 个评论
Thulasi Durai Durai Samy
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 .

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by