Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MATLAB for Machine Learning

You're reading from  MATLAB for Machine Learning

Product type Book
Published in Aug 2017
Publisher Packt
ISBN-13 9781788398435
Pages 382 pages
Edition 1st Edition
Languages
Authors (2):
Giuseppe Ciaburro Giuseppe Ciaburro
Profile icon Giuseppe Ciaburro
Pavan Kumar Kolluru Pavan Kumar Kolluru
Profile icon Pavan Kumar Kolluru
View More author details
Toc

Table of Contents (17) Chapters close

Title Page
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
1. Getting Started with MATLAB Machine Learning 2. Importing and Organizing Data in MATLAB 3. From Data to Knowledge Discovery 4. Finding Relationships between Variables - Regression Techniques 5. Pattern Recognition through Classification Algorithms 6. Identifying Groups of Data Using Clustering Methods 7. Simulation of Human Thinking - Artificial Neural Networks 8. Improving the Performance of the Machine Learning Model - Dimensionality Reduction 9. Machine Learning in Practice

Exporting data from MATLAB


Many of the functions we have used to import data into MATLAB have a corresponding function that allows us to export data. At the beginning of the chapter, we learned to save our data for later use with the save command:

>> save filename.mat

Note

Remember, this command saves all contents of the workspace in a compressed file with a .mat extension, called a MAT-file.

The dlmread() function allows us to handle text files with a specified delimiter. We can use this function to write a matrix to an ASCII-delimited file. To test the function, we start from a matrix of random numbers:

>> MyMatrix = rand(5)
MyMatrix =
    0.7577    0.7060    0.8235    0.4387    0.4898
    0.7431    0.0318    0.6948    0.3816    0.4456
    0.3922    0.2769    0.3171    0.7655    0.6463
    0.6555    0.0462    0.9502    0.7952    0.7094
    0.1712    0.0971    0.0344    0.1869    0.7547

Now simply write a matrix named MyMatrix to a file named MyMatrix.txt using the default delimiter...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime