Week 3 - Student Led Review
Reminder - the best place to learn MATLAB (or anything, really) is the internet! StackOverflow and MathWorks’ own MATLAB Exchange
are filled to the brim with people asking and answering questions about MATLAB. MATLAB’s own documentation is also extensive and extremely helpful.
It includes descriptions of how to call functions as well as usage examples.
Download this page as a PDF here (this document is generated automatically - print this page to PDF from your browser for the best result).
Return to Lectures
Student Questions
Allow students to ask questions about their own work or previous lessons, and encourage other students to answer them. If no students answer, instructors
may then answer.
Review Questions
Instructors can use the below questions to test the students’ understanding.
- What does MATLAB stand for?
- What are the three major components of the MATLAB default window?
- Current Folder (file explorer), Command Window, Workspace
- If you run a = 5 a command in the Command Window, what should happen?
- Should print output to the command window and save a in the workspace
- What command do you use to add external data to your workspace?
- How does MATLAB store numeric values?
- Double-precision floating point numbers in matrices.
- What command would I type to assign the elements in the third row, fourth to sixth column of the matrix a to the variable c without any output?
- How do use a function written elsewhere in my current script?
- Call it from the same directory, or add its location to the MATLAB PATH variable.
- How can you access the last element in a MATLAB array?
- What is the command to create a plot in MATLAB?
- Write a command to create a list of values starting at 1 and ending at 13, stepping by 0.5.
- Write a command to create a list of 400 values evenly spaced from 100 to 10 (decreasing).
- How can you easily generate a list of logarithmically spaced values?
- What is the difference between / and ./?
- The first indicates division, the second element-wise division through a matrix.
- Write an anonymous function that takes two numbers and returns the first to the power of the second (this function should be able to operate element-wise). Do not suppress the output.
- *my_function = @(a,b) a.^b
- What functions do you call to add labels to the horizontal and vertical axes?
- xlabel and ylabel, respectively
- What function would you use to provide custom names for the ticks on the horizontal axis?
- How do you retrieve the axes from the current figure in order to edit them programmatically?
- How do you plot multiple lines on the same figure?
- hold on or provide the data as a 2D matrix on the initial call