|
Published:
June 29, 2021

MATLAB For Dummies

Overview

Go from total MATLAB newbie to plotting graphs and solving equations in a flash!

MATLAB is one of the most powerful and commonly used tools in the STEM field. But did you know it doesn’t take an advanced degree or a ton of computer experience to learn it? MATLAB For Dummies is the roadmap you’ve been looking for to simplify and explain this feature-filled tool.

This handy reference walks you through every step of the way as you learn the MATLAB language and environment inside-and-out. Starting with straightforward basics before moving on to more advanced material like Live Functions and Live Scripts, this easy-to-read guide shows you how to make your way around MATLAB with screenshots and newly updated procedures. It includes:

  • A comprehensive introduction to installing MATLAB, using

its interface, and creating and saving your first file

  • Fully updated to include the 2020 and 2021 updates to MATLAB, with all-new screenshots and up-to-date procedures
  • Enhanced debugging procedures and use of the Symbolic Math Toolbox
  • Brand new instruction on working with Live Scripts and Live Functions, designing classes, creating apps, and building projects
  • Intuitive walkthroughs for MATLAB’s advanced features, including importing and exporting data and publishing your work
  • Perfect for STEM students and new professionals ready to master one of the most powerful tools in the fields of engineering, mathematics, and computing, MATLAB For Dummies is the simplest way to go from complete newbie to power user faster than you would have thought possible.

    Read More

    About The Author

    John Paul Mueller is an author and technical editor with experience in application development, database management, machine learning, and deep learning. He has written hundreds of books and articles helping everyday people learn everything from networking to database management.

    Sample Chapters

    matlab for dummies

    CHEAT SHEET

    MATLAB is an incredibly flexible environment that you can use to perform all sorts of math tasks. A large array of engineering and science disciplines can use MATLAB to meet specific needs in their environment. Using such a complex environment can prove daunting at first, but this Cheat Sheet can help: Get to know common MATLAB commands; become familiar with common operators and precedence; and learn to recognize line plot styles.

    HAVE THIS BOOK?

    Articles from
    the book

    MATLAB is so popular that you can get literally hundreds of add-ons for it. You can find the add-on you want in most cases; sometimes it just takes a little looking. For example, if you have the student version of the product, you can see a list of applicable add-ons at MATLAB Student. You can also find some free add-ons available for MATLAB at DownV.
    MATLAB is an excellent tool that performs a great many tasks. Adding MATLAB proficiency to your résumé may be the thing that gets your foot in the door for that bigger, better job you’ve been wanting. Working with green technology Today the energy picture is far different because many homes and businesses now produce energy in addition to using it.
    A lot of people dismiss comments as an exercise designed to waste time. But comments are actually invaluable in helping you to remember why you did something in a certain way and to avoid techniques that haven't worked in the past. Beyond general documentation, however, comments can help you avoid mistakes. Following are some of the benefits that you derive from good comments: Comments can document techniques that have or haven't worked in the past.
    Download the code example files for MATLAB For Dummies, 3rd Edition. These files contain all the sample code from the book. Use them to work through all the MATLAB examples described in the book. During the writing of this book, a few of our beta readers reported some odd behavior from their anti-virus programs.
    The following table contains a listing of commands that you use relatively often in MATLAB. You won't find every command listed — that would require a book in itself. However, these commands are usually used several times each session. Command Purpose cla Clears the current plot clc Clears the Command window
    The MATLAB prompt is that place where you type formulas, commands, or functions or perform tasks using MATLAB. It appears in the Command window. Normally, the prompt appears as two greater-than signs (>>). However, when working with some versions of MATLAB, you might see EDU>> (for the student version) or Trial>> (for the trial version) instead.
    MATLAB provides a few plots that create animated effects. One of the more interesting plots that naturally lends itself to presentations is the comet() plot. When you create a plot using this function, the beginning of the line forms the comet head, while the end of the line forms the tail. As MATLAB performs the calculation and creates more points, the comet moves along its way until the plot is finished.
    A lot of places online tell you about good MATLAB coding practice. In fact, if you ask five developers about their five best coding practices, you get five different answers, partly because everyone is different. The following list represents the best coding practices from a number of sources that have stood the test of time.
    To make data useful, you need to be able to open the MATLAB files containing it. Otherwise, there isn’t any point in saving the data. Likewise, not all your colleagues will have a copy of MATLAB, or they may want to use a different application to interact with the MATLAB data. For you to use their data, you must be able to import data files created by other applications.
    People tend to forget things. You might know how your MATLAB script works on the day you create it and possibly even for a week after that. However, six months down the road, you may find that you don’t remember much about the script at all. That’s where comments come into play. Using comments helps you to remember what a script does, why it does it in a certain way, and even why you created the script in the first place.
    You use datetick() to add dates to a plot axis in MATLAB. When using datetick(), you need an axis that has numbers that are in the range of the dates you need. For example, when you type datenum(‘9,15,2014’) and press Enter, you get an output value of 735857. When datetick() sees this value, it converts the number to a date.
    You would have a tough time presenting formulas to others without being able to use math symbols. MATLAB provides you with a wealth of symbols that you can use for output purposes. Here are the most commonly used symbols and how you access them.FractionDisplaying a fraction onscreen doesn’t always include a numeric fraction; it could be a formula that requires that sort of presentation.
    You can add animation using MATLAB. The static image playback approach, also called a movie, requires that you grab a series of screenshots of your data as it changes by calling getframe(). Most of the examples of using getframe() show it being used to grab the default object, which are the axes. However, you can supply a handle to any object and make it the focus of your movie.
    Once you know how to enter vectors and matrices in MATLAB, it’s time to see how to perform math using them. Adding and subtracting is a good place to start. The essential rule when adding and subtracting vectors and matrices is that they must be the same size. You can’t add or subtract vectors or matrices of different sizes because MATLAB will display an error message.
    The MATLAB layout is designed to make experimentation easy and comfortable for you. However, you may find after a while that it really doesn’t meet your needs. Fortunately, you can reconfigure the MATLAB layout to any configuration you want. Here are some ideas on how you can reconfigure the MATLAB layout. Minimizing and maximizing windows Sometimes you need to see more or less of a particular window.
    Experimentation is an essential part of working with MATLAB. After you get a particular command just right, you may want to add it to a script. This act involves cutting and pasting the information. When working in the Command window, simply highlight the text you want to move into a script, right-click it, and choose Copy or Cut from the context menu.
    Directly changing a data source is one way to create animation in MATLAB. The technique involves creating a link between the plot data and the data source. You can create a local data source, such as a variable, to create the animation, but this technique is more likely used with external data sources. YSource = [2, 0, 1, 4, 5, 2, 3]; Bar1 = bar(YSource); set(Bar1, ‘YDataSource’, ‘YSource’); set(gca, ‘YLim’, [0, 8]); for i = 2:7 YSource(3) = i; pause(2); refreshdata; end The code begins with a simple bar chart.
    You have all sorts of ways to interact with plot data directly. By using the pause() function, in MATLAB, you can create an animation of these changes. In this case, the bars in the first row of the 3D bar chart change color one at a time. You could use such an effect during a presentation to bring focus to a particular data item.
    MATLAB supports both error and warning messages. You have a number of ways to create exceptions based on application conditions. The easiest way is to use the error() and warning() functions. The first creates an error condition, while the second creates a lesser, warning condition. This example presents a basic method of issuing an error or warning due to user input.
    You can create images using MATLAB. All you need is a mathematical model that describes the points used to describe the image shape. For example, to draw a square, you simply provide the x- and y-axis coordinate for each corner. You can see a number of these shapes demonstrated at MathWorks.com. The following steps help you create an image of your own.
    Many elegant programming techniques exist in MATLAB, but none are quite so elegant as the recursive function. You create a function that keeps calling itself until a condition is satisfied, and then the function delivers an answer based on the results of all those calls. This process of the function calling itself multiple times is known as recursion, and a function that implements it is a recursive function.
    Giving an application the capability to perform tasks repetitively with MATLAB is an essential part of creating an application of any complexity. Humans don’t get bored performing a task once. It’s when the task becomes repetitive that true boredom begins to take hold. A computer can perform the same task in precisely the same manner as many times as needed because the computer doesn’t get tired.
    You can create your plots a few different ways. MATLAB makes creating a plot easy. Of course, before you can create any plot, you need a source of data to plot. Creating a plot using commands The following steps help you create a data source and then use that data source to generate a plot. Even though MATLAB’s plotting procedure looks like a really simplistic approach, it’s actually quite useful for any data you want to plot quickly.
    MATLAB provides a number of ways in which to create multidimensional arrays. The first method is to simply tell MATLAB to create it for you and fill each of the elements with zeros. Creating a multidimensional matrix The zeros() function helps you perform this task. To create a 2 x 3 x 3 matrix, you type aj = zeros(2, 3, 3) and press Enter.
    In MATLAB, a quiver plot shows the velocity vectors defined by the components u and v at points described by the coordinates defined by x and y. (Read more about the composition of velocity vectors.) When you don’t specify x and y, the plot is created using equally spaced values along the x-axis with a value of y = 1.
    You can employ the least squares fit method in MATLAB. Least squares fit is a method of determining the best curve to fit a set of points. You can perform least squares fit with or without the Symbolic Math Toolbox. Using MATLAB alone In order to compute this information using just MATLAB, you need to do a lot of typing.
    Multiplication occurs at several different levels in MATLAB. Here, the process is broken down to the act of matrix multiplication so that you can see each level as it progresses. Multiplying two vectors Vectors are just matrices of only one row or column. Remember that you create a row vector by separating values using a comma, such as [1, 2].
    For visual information to be meaningful and more informative, you can use MATLAB to add titles, labels, legends, and other enhancements to plots of any type. Here are some tips for enhancing your plot. Getting an axes handle Before you can do anything, you need a handle to the current axes. The best way to obtain such a handle is to type Bar2Axes = gca() (Get Current Axes) and press Enter.
    MATLAB performs math tasks incredibly well. Sometimes people get so caught up in “what else” an application can do that they miss the most interesting facts that are staring them right in the face. One of the most important things you can do in MATLAB performs is enter formulas. Entering a formula To enter a formula, you simply type it.
    Think about how you use data when working with math: The data appears as a list of numbers or text. MATLAB uses a similar viewpoint. It also works with lists of numbers and text that you create through various methods. Entering values inside square brackets The left square bracket, [, starts a list of numbers or text.
    The GUI method of working with folders in MATLAB requires the Current Folder window. (To display this window, choose Layout→Current Folder in the Environment group of the Toolstrip’s Home tab.) In this case, the Current Folder toolbar appears at the top of the Current Folder window. You can place it below the Toolstrip by choosing Layout→Current Folder Toolbar→Below Toolstrip in the Environment group of the Home tab.
    MATLAB can help you find data deviations. An error bar chart shows the level of confidence in each data point along a line. What you see is the transition between data points as a solid line, and then a bar that shows the amount of deviation, both positive and negative, from that point. A viewer can tell whether the data is truly accurate or simply a guess by looking at the amount of deviation for particular points along the line.
    Everyone needs help from time to time. Even the experts can’t remember everything that MATLAB does, and notes go only so far in jogging the memory. So, when you need help, don’t feel as though you’re the only one seeking it. Most of the MATLAB-specific help information appears in the Resources group of the Toolstrip’s Home tab.
    Sometimes you don’t need an entire file imported into MATLAB, only certain rows and columns of it. The csvread() function provides a straightforward example of how to perform this task. To see just a range of data displayed, type CSVOutput = csvread(‘NumericData.csv’, 0, 0, [0, 0, 1, 1]) and press Enter. You see the following output: CSVOutput = 15 25 18 29 The first argument to csvread() is the name of the file to read.
    You will need to know a few things before you work with images in MATLAB. Images are more complex than text files because they use binary data that isn’t easy for humans to understand, and the format of that data is intricate. Small, hard-to-diagnose errors can cause the entire image to fail. However, the process of exporting and importing images is relatively straightforward.
    A problem that anyone can encounter is getting a bad MATLAB installation or simply not having the right software installed. When you can’t use your software properly, the entire application experience is less than it should be. Check out the following tips to guide you through the MATLAB installation so that you can have a great experience using it.
    Once you have obtained a copy of the Symbolic Math Toolbox to use with MATLAB, you should have a number of files on your hard drive. These files provide everything needed to install the Symbolic Math Toolbox. You have two ways by which you can interact with the files: If you were able to use the download agent, you see a dialog box telling you that the download is complete.
    You can create a 3D bar chart in MATLAB. The bar chart is a standard form of presentation that is mostly used in a business environment. You can use a bar chart to display either 2D or 3D data. When you feed a bar chart a vector, it produces a 2D bar chart. Providing a bar chart with a matrix produces a 3D chart.
    The Current Folder window really does show the current MATLAB folder listed in the Address field. You don’t see anything because the current folder has no files or folders to display. However, you can add files and folders as needed to store your MATLAB data. Permanently changing the default folder The default folder is the one that MATLAB uses when it starts.
    The fonts you use in MATLAB can say a lot about your presentation. Here are the four ways in which you can modify the appearance of fonts in MATLAB to good effect: Bold Monospace Italic Underline Bold The use of emphasis, normally associated with bold type, can make data stand out. However, in MATLAB, the term bold actually refers to font weight.
    At some point, you’ll want to change the content of your plot in MATLAB. Perhaps you want to add a legend or change how the data is presented. After you get the data looking just right, you might need to label certain items or perform other tasks to make the output look nicer. You can modify any plot you create using either commands or the MATLAB GUI.
    How the 3D effect appears onscreen depends on the data aspect ratio you set in MATLAB. The daspect() function lets you obtain the current aspect ratio and set a new one. The aspect ratio is a measure of how the x-, y-, and z-axis interact. For example, an aspect ratio of [1, 2, 3] would mean that for every 1 unit of the x-axis, there are two units of the y-axis and three units of the z-axis.
    MATLAB allows you to modify the plot box aspect ratio. Instead of modifying the data, the plot box aspect ratio modifies the plot box — the element that holds the plot in its entirety — as a whole. The appearance of the data still changes, but in a different way than before. The following steps get you started with this example:Type YSource = [1, 3, 5; 3, 7, 9; 5, 7, 11]; and press Enter.
    You need to obtain either a trial version or a purchased version of the Symbolic Math Toolbox before you can do anything else with it in MATLAB. (When getting a trial version, you must discuss the download with someone from MATLAB before you can actually download the product.) Check out the product information and click one of the links in the Try or Buy section of the page.
    MATLAB lets you perform a wide range of algebraic tasks even without the Symbolic Math Toolbox installed, but adding the Toolbox makes performing the tasks easier. Here, you discover how to use the Symbolic Math Toolbox to perform a variety of algebraic tasks. Differentiating between numeric and symbolic algebra The essential difference between numeric and symbolic algebra is that the first is used by computer science to explore principles of algebra using symbols in place of values, while the second is used by science to obtain approximations of equations for real-world use.
    MATLAB does so many neat little math tricks. As with matrix multiplication in MATLAB, matrix division takes place at several different levels. Keep reading to explore division at each level. Dividing a vector by a scalar Dividing a vector by a scalar and producing a usable result is possible. For example, type m = [2, 4, 6] / 2 and press Enter.
    You can perform reduction using MATLAB, and doing so requires only a couple of steps. Reduction lets you see the structure of what a matrix represents, as well as to write solutions to the system. MATLAB provides the rref() function to produce the Reduced Row Echelon Form (RREF). There is an interesting tool that you can use to see the steps required to produce RREF using any matrix as input.
    Printing your MATLAB work is one of the tasks that most people use the GUI to perform, even the most ardent keyboard user. The issue is one of convenience. Yes, you can use the printopt() and print() functions to perform the task using the keyboard, but only if you’re willing to perform the task nearly blind. The GUI actually shows you what the output will look like (or, at least, a close approximation).
    At some point, you want to publish the information you create in MATLAB. Of course, most of the time, you don’t need to publish a matrix or other source data. What you want to publish are the plots you create from the data. A picture is worth a thousand words — you’ve heard the phrase a million times, yet it still holds true.
    Everyone makes mistakes, even with MATLAB. You might think that experts don’t make mistakes, but any expert who says so definitely isn’t an expert. Making mistakes is part of the learning process. It’s also part of the discovery process. If you want to do anything important with MATLAB, you’re going to make mistakes.
    Scripts usually aren’t perfect the first time you write them in MATLAB. Editing them quite a few times is common. Even if the script does happen to attain perfection, eventually you want to add features, which means revising the script. The point is, you commonly see your scripts in the Editor window more than once.
    After you create a formula or command that you want to use to perform a number of calculations in MATLAB, be sure to save it to disk. Of course, you can save anything that you want to disk. The following steps help you save any formula or command that you want to disk so that you can review it later:Choose a location to save the formula or command in the Address field.
    Error messages always provide you with any details that the application provides. Warning messages are different — you can tell MATLAB to provide only certain details as needed. You can set the configuration globally or base it on the message identifier (so that warnings with some identifiers provide more information than others do).
    When working with differential equations, MATLAB provides two different approaches: numerical and symbolic. Here, you can see both approaches to solving differential equations. This is just an overview of the techniques; MATLAB provides a rich set of functions to work with differential equations. Using the numerical approach When working with differential equations, you must create a function that defines the differential equation.
    When you first start MATLAB, the current folder always defaults to the MATLAB folder found in your user folder for the platform of your choice. For Windows users, that means the C:UsersUser Name>DocumentsMATLAB folder. Burying your data way down deep in the operating system may seem like a good idea to the operating system vendor, but you can change the current folder location to something more convenient when desired.
    It’s time to take your first steps beyond using MATLAB as a simple calculator. You can use the following MATLAB functions to perform complex tasks. Take a look to get going. Learning the truth Determining whether something is true is an important part of performing most tasks. You determine the truth value of the information you receive almost automatically thousands of times a day.
    MATLAB provides a number of commands that you can use to perform basic statistics tasks. When working with descriptive statistics, the math quantitatively describes the characteristics of a data collection, such as the largest and smallest values, the mean value of the items, and the average. This form of statistics is commonly used to summarize the data, thus making it easier to understand.
    You can use MATLAB with the Symbolic Math Toolbox to solve a number of simple calculus problems. Calculus can solve myriad problems that algebra can’t. It’s really the study of how things change. This branch of math is essentially split into two pieces: differential calculus, which considers rates of change and slopes of curves, and integral calculus, which considers the accumulation of quantities and the areas between and under curves.
    Built-in functions are those that come with MATLAB or are part of an add-on product. You typically don’t have source code for built-in functions and must treat them simply as black boxes. So far, you have relied exclusively on built-in functions to perform tasks in MATLAB. Learning about built-in functions There are many ways you can learn about built-in functions, but if you already know the name of a function, one of the simplest makes use of the help(‘function_name’) command, where function_name is the name of the function.
    MATLAB supports a few interesting additions to the standard functions. In general, these additions are used to support complex applications that require unusual programming techniques. However, it pays to know that the functions exist for situations in which they come in handy. Inline functions An inline function is one that performs a small task and doesn’t actually reside in a function file.
    MATLAB allows you to display your plots however you choose. Here are three plots — one on top of the other. You don’t have to display the plots in this manner. Instead, you can display them side by side (or even in a grid). To make this happen, you use the subplots feature of MATLAB. A subplot is simply a plot that takes up only a portion of the display.
    Sometimes you need to use special characters and character formatting in MATLAB. Here, you find out how to add Greek letters to your output, as well as work with superscript and subscript as needed. Greek letters The 24 Greek letters are used extensively in math. To add these letters to MATLAB, you must use a special escape sequence.
    You have a shiny new MATLAB function and you’re just itching to use it. Before you can use the function, you must make sure that the directory containing the function file is part of the MATLAB path. You can achieve this goal in two ways: Double-click the directory entry in the Current Folder window. Right-click the directory entry in the Current Folder window and choose Add to Path→Selected Folders and Subfolders from the context menu.
    Using a color bar with your MATLAB plot can help people see data values based on color rather than pure numeric value. The color bar itself can assign human-understandable values to the numeric data so that the data means something to those viewing it. The best way to work with color bars is to see them in action.
    The MATLAB Command window is where you perform most of your experimentation. While you perform really simple tasks using the Command window, it can do quite a lot for you. Here are some of the ways in which you can use the Command window to learn more about MATLAB. Typing a really simple command You can type any formula or command desired in the Command window and see a result.
    The simplest decision to make is whether to do something — or not. However, you might need to decide between two alternatives in MATLAB. When a situation is true, you perform one task, but when it’s false, you perform another task. There are still other times when you have multiple alternatives and must choose a course of action based on multiple scenarios using multiple related decisions.
    In MATLAB, you can create any multiple alternative selection code needed using the if...elseif statement. However, you have another good way to make selections. A switch statement lets you choose one of a number of options using code that is both easier to read and less time-consuming to type. The result is essentially the same, but the method of obtaining the result is different.
    Creating a function in MATLAB is only slightly more work than creating a script. In fact, the two processes use the same editor, so you’re already familiar with what the editor can provide in the way of help. The various Editor features you’d use for creating a script all work the same way with functions, too.
    MATLAB provides many different ways to write scripts. Some of them don’t actually require that you write anything at all! However, the traditional way to create a script in any application is to write it. The most common first script in the entire world is the “Hello World” example. The following steps demonstrate how to create such a script using MATLAB.
    Whenever you create a plot in MATLAB, you need to identify the sources of information using more than just the lines. Creating a plot that uses differing line types and data point symbols makes the plot much easier for other people to use. The following table contains a listing of the line plot styles. Color Marker Style Code Line Color Code Marker Style Code Line Style b blue .
    You need to know which operators MATLAB supports, but remember them all isn't easy. The following table provides a brief summary of the operators that MATLAB supports. Operator Type Description Example - Arithmetic Subtracts the right operand from the left operand. 5 - 2 = 3 * Arithmetic Multiplies the right operand by the left operand.
    When you have data inside MATLAB and want to export it, the goal is to ensure that the resulting file is standardized so that the recipient has minimum problems using it. As a result, you’d use writetable() only if the recipient really did require a custom format rather than a standard .csv file, or if the MATLAB data was such that you had to use something other than csvwrite().
    MATLAB provides specific file types for specific needs. To get the most out of MATLAB, you need to know about the different file types.The following list tells you about the MATLAB file types and describes their uses: .fig: Provides access to any plots or other graphics you create. Keep in mind that the file contains all the information required to reconstruct the graphic, but does not contain the graphic itself.
    MATLAB is an incredibly flexible environment that you can use to perform all sorts of math tasks. A large array of engineering and science disciplines can use MATLAB to meet specific needs in their environment. Using such a complex environment can prove daunting at first, but this Cheat Sheet can help: Get to know common MATLAB commands; become familiar with common operators and precedence; and learn to recognize line plot styles.
    A basic import uses all the default settings, which works fine for many kinds of data. MATLAB can determine the correct data format relatively often. An essential part of importing data is to use the correct import function. Each import function has features that make it more suitable to a particular kind of data.
    Knowing the order in which tasks are performed is essential. Otherwise, the formulas you type won't work as expected and you'll obtain errant results. The following table shows the order in which MATLAB evaluates various operators. You can also remember operator precedence using the PEMDAS acronym, which stands for Parentheses, Exponent, Multiply And Divide, Add and Subtract.
    Computers contain memory, much as your own brain contains memory. The computer’s memory stores information that you create using MATLAB. Looking at memory as a kind of storage locker can be helpful. You open the door, put something inside and then close the door until you need the item again. When that happens, you simply open the door and take the item out.
    MATLAB is used in a lot of different ways by lots of people in occupations you might not necessarily think about when it comes to a math product. In fact, math is used in ways that many people don’t consider. Engineering new solutions Many engineering disciplines rely on various kinds of math to ensure that the results of any design process or new theory of how the universe works actually make sense.
    The MATLAB syntax is a set of rules that you use to tell MATLAB what to do. It’s akin to learning another human language, except that the MATLAB syntax is significantly simpler than any human language. In order to communicate with MATLAB, you must understand its language, which is essentially a form of math. Because you already know math rules, you already know many MATLAB rules as well.
    MATLAB provides the EZPlot method of working with formulas to help you easily see how the formula looks graphically without taking a lot of time to do it. With this approach, you can focus on refining the formula results rather than the associated plot. The plotting time is negligible. The disadvantage of this approach is that it lacks flexibility.
    MATLAB provides a wealth of easy plotting methods. When you couple these plotting methods with anonymous functions, you can work quickly on solving problems rather than waste time trying to figure out the more complex commands in MATLAB. Anonymous functions make creating a function easy without all the usual overhead of a named function in a file.
    MATLAB can perform some pretty tricky calculations. While that is all well and good, don’t neglect the ability of MATLAB to act as a calculator. If you want to take advantage of this, you will need to know how to use the Command window. Changing the Command window formatting For example, if you don’t want the extra space between lines that MATLAB provides by default, you can type format compact and press Enter to get rid of it.
    You can perform all sorts of math operations with matrices in MATLAB. You may find yourself needing to create powers of matrices or using complex numbers. MATLAB to the rescue! Creating powers of matrices Sometimes you need to obtain the power or root of a matrix. The most common method is to use the circumflex (^) to separate the matrix from the power to which you want to raise it.
    https://cdn.prod.website-files.com/6630d85d73068bc09c7c436c/69195ee32d5c606051d9f433_4.%20All%20For%20You.mp3

    Frequently Asked Questions

    No items found.