Book Image

MATLAB for Machine Learning - Second Edition

By : Giuseppe Ciaburro
Book Image

MATLAB for Machine Learning - Second Edition

By: Giuseppe Ciaburro

Overview of this book

Discover why the MATLAB programming environment is highly favored by researchers and math experts for machine learning with this guide which is designed to enhance your proficiency in both machine learning and deep learning using MATLAB, paving the way for advanced applications. By navigating the versatile machine learning tools in the MATLAB environment, you’ll learn how to seamlessly interact with the workspace. You’ll then move on to data cleansing, data mining, and analyzing various types of data in machine learning, and visualize data values on a graph. As you progress, you’ll explore various classification and regression techniques, skillfully applying them with MATLAB functions. This book teaches you the essentials of neural networks, guiding you through data fitting, pattern recognition, and cluster analysis. You’ll also explore feature selection and extraction techniques for performance improvement through dimensionality reduction. Finally, you’ll leverage MATLAB tools for deep learning and managing convolutional neural networks. By the end of the book, you’ll be able to put it all together by applying major machine learning algorithms in real-world scenarios.
Table of Contents (17 chapters)
Free Chapter
1
Part 1: Getting Started with Matlab
4
Part 2: Understanding Machine Learning Algorithms in MATLAB
9
Part 3: Machine Learning in Practice

Reading ASCII-delimited files

The readmatrix() function in MATLAB allows you to read the contents of a text file into a matrix. It is a convenient way to load numerical data from a delimited or fixed-width text file. The basic syntax for using readmatrix is as follows:

NumMatrix = readmatrix('NumMatrix.txt');

The function will attempt to infer the delimiter used in the file automatically. You can also specify additional options to customize the behavior of readmatrix, such as specifying the range of rows or columns to read, handling missing data, specifying the delimiter explicitly, and more. Here’s an example:

NumMatrix = readmatrix('NumMatrix.txt', 'Range', 'A1:C3', 'Delimiter', ',');

In this example, the Range option is used to specify that only the data in the range A1 to C3 should be read, and the Delimiter option specifies that the data is comma-separated. The following results are returned:

NumMatrix...