Introduction to the cell in MATLAB

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.