MATLAB essential/Quiz 1: Lecture 1 + Lecture 2

Resource type: this resource is a quiz.

You can refer to the previous lectures or even use Google while taking this quiz. Do NOT use MATLAB while taking the quiz. The point of this quiz is to make sure that you understand what was covered so far, by using MATLAB, you are cheating yourself.

This quiz will contain questions about the material covered in the first two lectures ( general information + arrays + how to solve equations ). The first few questions ask you to write a short pieces of code. The answers are in a google document. Once you finish the quiz send me an email. and I will give you a link to the document. The second set of questions are multiple choice, and complete the statement. The answers for these question will be shown after you submit your answers. If you have any questions please do not hesitate to send me an email..

complete the text, True or False, and multiple choice

Figure#1
Point added for a correct answer:   
Points for a wrong answer:
Ignore the questions' coefficients:

1. Complete the text:

By looking at figure#1, click on image to see full size, window number one is the , number 2 is the , and window number three is .

2. Complete the text:

The keyword for integration is and the keyword for differentiation is

3. Complete the text:

When defining a variable in MATLAB, the keyword must be used

4. Complete the text:

The command is used whenever you want to know more information about a certain function command using MATLAB command window.

5. Which of the commands below you use to define this function f(x)= \tfrac{e^x}{x} + \sqrt{x} :.

TRUE
FALSE

6. True or False, The percent sign (%) in used to suppress the outcome of a piece of code.

TRUE
FALSE

7. Which of the commands below you use to define this function f(x)= \tfrac{e^x}{x} + \sqrt{x} :.

f=(x) exp(x)/x + sqrt(x)
f=@(x) exp^(x)/x + sqrt(x)
f=@(x) e(x)/x + sqrt(x)
f=(x) exp(x)/x + sqrt(x)
f=@(x) exp(x)/x + sqrt(x)

8. Choose the right answer. Which one of these matrices will be create with this MATLAB code : B=[ 1 2 3 ; 3 2 1 ] :.

B= \begin{bmatrix} 1 & 1 \\2 & 2 \\ 3 & 3 \end{bmatrix}
B= \begin{bmatrix} 1 & 2 & 3 \\1 & 2 & 3 \end{bmatrix}

Your score is 0 / 0

Write MATLAB code

Question 1

Using MATLAB, write any two matrices that when added together using MATLAB yield the following matrix A= \begin{bmatrix} -4 & 2.5 & 0 \\20 & 5 & 1 \end{bmatrix}.

Question 2

Using MATLAB, write any two matrices that when subtracted together using MATLAB yield the following matrix: B= \begin{bmatrix} 1 & -13 & 8 \\40 & 50 & 10 \end{bmatrix}.

Question 3

What is the function of (%), (@), and (;) symbols.

Question 4

Briefly describe the difference between Command window and Editor.


Question 5

If you have the following equation: {\textstyle f(x)= e^x + sin(5x)}. You want to find the solution of this equation using MATLAB. How do you express this function in MATLAB syntax ?

Question 6

Write a MATLAB code to differentiate the following function twice:

e^x\sqrt{sinx + cosx}

Question 7

Write a MATLAB function to partially differentiate the following function with respect to y:

z(x,y)= e^y+sin(xy)cos(yx)

Question 8

Write a MATLAB code to integrate the following function from 1 to infinity:

\int (log(x))^2

Question 9

write the code to find the anwer of the follwing equation using using MATLAB

\lim_{x \to \infty} \frac{x}{sin(x)} = L

Question 10

The code below will give an error, why? and how can you fix it ? DO NOT USE MATLAB.

x=[11,24,32 ; 21 32 43 ]
y=[25 31 42; 26 37 48]
x*y

How to get solution for quiz

You can the solutions in one of two way:

1_ Send me an email when you finish the quiz, and I will send you a link to a google document that contains the answers.

2_ Send me your answers, and I will correct them and send them back to you within 24 hours

This article is issued from Wikiversity - version of the Thursday, December 24, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.