Familiarize yourself with the course.
Course Overview
- You can execute commands by entering them in the command window after the MATLAB prompt (>>) and pressing the Enter key.
TASK
Multiply the numbers 3 and 5 together with the command 3*5.
- Unless otherwise specified, MATLAB stores calculations in a variable named ans: 7 + 3 ans = 10
TASK
Assign the 35 calculation to a variable named m as shown: m = 35
- The equals sign (=) in MATLAB is the assignment operator, meaning that the expression on the right of the equals sign is assigned to the variable on the left.
When you enter x = 3 + 4, MATLAB first evaluates 3 + 4 and then assigns the result (7) to the variable x.
TASK
Enter the command m = m + 1 to see what happens.
- Notice that the Workspace window (on the right) shows all the variables currently in the workspace.
TASK
Create a variable named y that has the value m/2.
- When you enter a command without a semicolon at the end, MATLAB displays the result in the command prompt. x = 5 + 1 x = 6 If you add a semicolon to the end of a command, the result will not be displayed. The command will still be executed, as you can see in the workspace. x = 5 + 1;
TASK
Enter k = 8 - 2; with a semicolon at the end.
The result won't appear in the command prompt, but you can see the value in the Workspace window.
- You can recall previous commands by pressing the Up arrow key on your keyboard. Note that the Command Window must be the active window for this to work.
TASK
Press the Up arrow to return to the command m = 35 and edit the command to be m = 3k
- When you enter just a variable name at the command prompt, MATLAB returns the current value of that variable.
TASK
The value of y was calculated using m. Was y recalculated when m was modified? Enter just the variable name y at the command prompt (and press Enter).
- The value of y was unchanged because MATLAB does not rerun previous commands in the Command Window. If you want to recalculate y after m is modified, you need to repeat the command y = m/2. Try this now! Use the Up arrow to recall the command y = m/2, then press Enter. To see the new value of y, remember not to use a semicolon at the end of the command.
Enter commands in MATLAB to perform calculations and create variables.
Entering Commands Naming Variables Saving and Loading Variables Using Built-in Functions and Constants
Write and save your own MATLAB programs.
MATLAB Desktop and Editor The MATLAB Editor Running Scripts
Create MATLAB variables that contain multiple elements.
Manually Entering Arrays Creating Evenly-Spaced Vectors Array Creation Functions
Use indexing to extract and modify rows, columns, and elements of MATLAB arrays.
Indexing into Arrays Extracting Multiple Elements Changing Values in Arrays
Perform calculations on entire arrays at once.
Performing Array Operations on Vectors
Call functions to obtain multiple outputs.
Obtaining Multiple Outputs from Function Calls
Use the MATLAB documentation to discover information about MATLAB features.
Obtaining Help
Visualize variables using MATLAB's plotting functions.
Plotting Vectors Annotating Plots
Bring together concepts that you have learned with a project.
Project - Electricity Usage Project - Audio Frequency
Bring data from external files into MATLAB.
Import Tool Importing Data as a Table
Use logical expressions to help you to extract elements of interest from MATLAB arrays.
Write programs that execute code based upon some condition.
Programming Constructs Decision Branching For Loops
Bring together concepts that you have learned with a project.
Project - Stellar Motion Project - Stellar Motion II
Learn next steps and give feedback on the course.
Additional Resources
Note: I'm beginner please suggest any improvement 😁
Setting up MATLAB environment is a matter of few clicks. The installer can be downloaded from here
MathWorks provides the licensed product, a trial version and a student version as well. You need to log into the site and wait a little for their approval.
After downloading the installer the software can be installed through few clicks.
Contributions are welcome! For bug reports or requests please submit an issue.
Feel free to contact me to discuss any issues, questions, or comments.
- Email: Yaduvanshi05Bhupendra@gmail.com
- GitHub: Bhupendra Kumar Yadav
- LinkedIn: Bhupendra Kumar Yadav
This repository contains a variety of content; developed by Bhupendra Kumar Yadav, and some from third-parties. The third-party content is distributed under the license provided by those parties.
The content developed by Bhupendra Kumar Yadav is distributed under the following license:
I am providing code and resources in this repository to you under an open source license.
Copyright 2015 Bhupendra Kumar Yadav
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.