Differences between mwArray and general Arrays

Source: Internet
Author: User

Differences between mwArray and general Arrays

The following code can be used to understand the differences between mwArray and general arrays.

MwArray a (3, 2, mxDOUBLE_CLASS); double * aData; aData = new double [6]; int iii; for (iii = 0; iii <6; ++ iii) {aData [iii] = iii + 1;} // print output std: cout <"a =" <std: endl; std :: cout <aData [0] <", \ t" <aData [1] <std: endl; std :: cout <aData [2] <", \ t" <aData [3] <std: endl; std :: cout <aData [4] <", \ t" <aData [5] <std: endl;. setData (aData, 6); std: cout <"a (1,1) =" <
Running result [one-bit array to multi-dimensional array is organized by column first]

A =
1, 2
3, 4
5, 6
A (1, 1) = 1
A (1, 2) = 4
A (2, 1) = 2
A (2, 2) = 5
A (3, 1) = 3
A (3, 2) = 6


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.