1. The concept of cell in matlab
- cell , also known as a meta-package, is a matrix-like thing, it can hold any type of data , that is, matrix, string, numerical class;
2. Cell Creation
- The method of creating the cell : Directly using the c={a,b,e,d} form, but here the "[]" changed to "{}";
- Use cell to create CELL:C={C1,C2}, where C1 and C2 are cell types, directly C1, C2 as a The cell gets C3 is a 1*2 cell array, using C3 =[c1 C2], which is the contents of C1 and C2 to create the cell array;
- Use the cell function,A=cell (2,2), to create an empty 2*2 cell matrix;
3. About cell access:
- X=c (s) Use this form of return is the cell type
- X=c{s} The contents of the 栿 cell returned using this {} form
- The rest is basically the same as the usual array, matrix access
- a{1,1} (2,3:end) accesses all elements in the second row of the contents of the first cell in a, after the third element
- A{1,3}.name access is the name value of the struct in a{1,3} in a
- Cell graphical display using command Cellplot (A)
4. About cell deletion
- Cell (1) =[] Delete the first cell, do not use cell{1}=[], this is the first cell content empty content, not deleted
- Cell (:) =[] Delete all cells, other deletions and so on
- Re-reshape cell arrays with reshape
Introduction to the cell in MATLAB