In MATLAB, the cell array (cell) is converted to a matrix

Source: Internet
Author: User
In MATLAB, the cell array (cell) is converted to a matrix,

The cell is converted to a matrix function: Cell2mat (c), where C is the cell array to be converted;

Since the transformed matrix may not meet our requirements for matrix dimensions, the following two functions may be required:

--reshape (a,m,n,p,...), transform matrix A to m*n*p* ... The Matrix;

--permute (a,[1,3,2]), the 3rd and 2nd dimensions of matrix A are exchanged to meet the order requirements;

Here's an example I've used myself:

H--<k*1>cell, where each element is a four-dimensional matrix of u*s*n*t (H is the Winnerii channel matrix)

U: Number of receiving antennas S: Number of transmitting antennas N: Multipath number T: Sample points per link K: Link

In order to transform H into a five-D matrix of u*s*n*t*k, the following transformations are performed:

(1) H1=cell2mat (H);% converted to matrix, as shown, then H1 as (u*k) *s*n*t four-dimensional matrix

(2) H2=reshape (h2,u,k,s,n,t);% change the shape of the matrix H1

(3) h3=permute* (h2,[1,3,4,5,2];% The matrix that changes the matrix to U*s*n*t*k

In MATLAB, the cell array (cell) is converted to a matrix

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.