Practice Matrix generators - 2.5.13 | 2. Tutorial lessons - Part B | IT Workshop (Sci Lab/MATLAB)
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Matrix generators

2.5.13 - Matrix generators

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What does zeros(3,3) produce?

💡 Hint: Think about what the function `zeros` does.

Question 2 Easy

What function would you use to create a square matrix of size 2 filled with ones?

💡 Hint: Remember the name of the function for ones and check how the size is defined.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does the function ones(3,2) return?

A 3x2 matrix filled with ones
A 2x3 matrix filled with zeros
A 3x3 identity matrix

💡 Hint: Think about what the `ones` function creates.

Question 2

True or False: The function eye(m,n) returns an m-by-n matrix filled with random numbers.

True
False

💡 Hint: Recall what identity matrices are.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a 5x5 identity matrix and then create a 3x3 matrix filled with zeros. Combine them into a single matrix with the identity matrix on top of the zero matrix.

💡 Hint: Think about how to concatenate matrices both vertically.

Challenge 2 Hard

From the vector v = [10, 20, 30], create a diagonal matrix, and then replace the first diagonal element with 15. What is the new matrix?

💡 Hint: Use the `diag` function and understand how indexing works.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.