MATLAB Squeeze function __matlab

Source: Internet
Author: User
Tags rand
Squeeze to remove a dimension of size 1

B = Squeeze (A)

Description: B = Squeeze (a), B has the same element as a, but all but one row or column dimension (a singleton dimension) is removed. The characteristic of a singleton dimension is size (A,dim) = 1. The two-dimensional array is not affected by squeeze; If a is a row or column vector or a scalar (1-by-1) value, then B = A.

For example, Rand (4,1,3) produces an evenly distributed array, a total of 3 pages, 4 rows per page 1 columns, after squeeze, the 1-column dimension is gone, leaving only a two-dimensional array of 4 rows 3 columns. RAND (4,2,3) does not change after all squeeze because there are no 1 columns or 1 rows of dimensions.

Turn from: http://blog.sina.com.cn/s/blog_50363a790100wyeq.html

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.