A variable in MATLAB. Mat data is saved as txt

Source: Internet
Author: User

Because the data needs to be implemented between MATLAB and Vc, the data needs to be transferred.

After processing in MATLAB, the results are saved as. Mat data, but we all know that VC cannot directly process drops, so we need to convert them to the TXT file format,

Now, we can see that mat has saved the magic horse stuff:

Train_data: [24x66 double] train_label: [24x1 double] test_data: [500x66 double] test_label: [500x1 double] model: [1x1 struct] Pretrain: [24x1 double] pretest: [500x1 double]

Although there are so many things, only

Pretrain: [24x1 double]

He Nai, my mtalab was too frustrating. I asked my younger brother, and it was not difficult ,.

Because the Pretrain I want to get can be saved as an integer, the ultimate solution is:

Comment ', B, 'delimiter', '', 'newline', 'pc ');

This is fine. Of course, if you want to save it as a scientific notation, it is simpler:

% 1. read mat data into memory a = load ('11. mat ') % 2. the Nth variable is read into BB =. pretest; % save as scientific notation save a.txt-ASCII B

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.