官方帮助文档:https://ww2.mathworks.cn/help/matlab/ref/cell.html

数组创建与索引

  1. >> LC_type_IGBP_cell={'Evergreen Needleleaf Forests','Evergreen Broadleaf Forests','Deciduous Needleleaf Forests',...
  2. 'Deciduous Broadleaf Forests','Mixed Forests','Closed Shrublands',...
  3. 'Open Shrublands','Woody Savannas','Savannas',...
  4. 'Grasslands','Permanent Wetlands','Croplands',...
  5. 'Urban and Built-up Lands','Cropland/Natural Vegetation Mosaics','Permanent Snow and Ice',...
  6. 'Barren','Water Bodies','Unclassified'};
  7. >> LC_type_IGBP_cell(1)
  8. ans =
  9. 1×1 cell 数组
  10. {'Evergreen Needleleaf Forests'}
  11. >> LC_type_IGBP_cell{1}
  12. ans =
  13. 'Evergreen Needleleaf Forests'
  14. >> LC_type_IGBP_cell{end}
  15. ans =
  16. 'Unclassified'

元组读取数据

问题描述

  • image.png

    解决方案

  • 对元胞的内容进行索引。当您使用花括号 {} 进行索引时,将得到指定元胞中包含的数据段。

    • image.png
  • 参考官方帮助文档:cell

    向cell中添加和删除数据

  • 参考博客:matlab在cell中添加和删除数据

  • matlab在cell中删除数据
    • cell{end+1}=...
  • image.png
  • image.png
  • image.png
  • image.png

image.pngimage.png