Matlab

© All Rights Reserved

2 views

Matlab

© All Rights Reserved

- Tutorial Dynare
- cfnse
- Matlab Assignment-01 SEM-II-2016-2017.pdf
- Lab 1
- Matlab Part 4 Modeling and Simulation
- Machine Learning Course Handwriting Recognition
- Assignment01-dsp
- hmw1
- Week 5 Distributed Data Management Presentation - Part2 (1)
- MATLAB Assignment Help UK
- DSP--LAB#01
- Matlab Tutorial
- Main c Matlap v1.3
- Robot Control Through Gestures
- Electromagnetic Scattering by. Stratified Inhomogeneousmedia
- Embedded MATLAB
- Matlab_Vis3D_BKaus.pdf
- Adopt Al Alg and Trig 2012 Analytical Math Sullivan Final
- MatrixReview.r
- Matlab Notes

You are on page 1of 5

Homologation

Extra exercises (2015)

By: Bouke Haarsma

This document contains extra exercises for the Matlab-basics homologation module. These exercises

will be harder compared to the module offered on oncourse. (http://oncourse.tue.nl).

Please use these questions as confirmation you understand the material, so solve these exercises

individually! It is also recommended to use the mathworks documentation

(http://mathworks.com/help) and matlab help command, before asking for help or copying code

from Google. By doing so, you will be better prepared when help is not easily available.

Good luck!

Bouke

Exercises

1. Starting

a)

25

25 1

5 1

1

b. 3

( 5 + 1) 2

a.

b)

a. e 3 , ln(e 3 ),10 log(e 3 ),10 log(10 5 )

b. e 163

c. Solve 3 x = 17

c)

a.

d)

e)

f)

b. 3

Give an array of 10 elements in which each element has the value of the square of the

index.

Give an array of 10 elements in which the elements of odd index contain the square of

the index, while the even elements contain the third power of their index.

Theres a popular story that Gauss, mathematician extraordinaire, had a lazy teacher. The so-called

educator wanted to keep the kids busy so he could take a nap; he asked the class to add the

numbers 1 to 100.

a) Create a vector X which has the values from 1 to 100.

b) Take the sum of all elements to get the solution

Since Gauss did not have Matlab at the time, he used a different solution. He added the first and last

number in the series and multiplied it with the numbers of pairs in the series.

c) Add the first and the last index together in the variable P. Use X(end) to get the last number

in the vector.

d) Since the vector has an even number of numbers, use the length of the vector to determine

the number of pairs in the series.

e) Calculate the solution using the method from Gaus.

f) The solution given in c) d) and e) should work for all vectors. Create a script with the

commands from these questions, and test it with a vector from 1 to 300.

3. Going diagonal

Create the following matrices using one line in the command window without defining the matrix

element wise. (Use the Matlab help!):

0 0 0

a) = 0 0 0

0 0 0

1 1 1

b) = 1 1 1

1 1 1

1 0 0

c) = 0 1 0

0 0 1

1 0 0

d) = 0 2 0

0 0 3

2 0 0

e) = 2 2 0

2 2 2

f)

0 4 4

= 2 1 4

2 2 2

This exercise will create a function that will be used to plot circles. First a script will be created,

commands in the script will be later used to create a function.

a) Create a script called Ex1. Since a full circle will be drawn, this means angle is between 0

and 2 radians. So in the script, create a vector called theta containing all numbers between

0 and 2 with a step size of 1 .

b) Run the script. Verify if a) has 6 elements. Why should it have 6 elements? Why does the

vector end at 6 and not at 2?

c) The circle will have a certain radius. Call this radius R. Edit the script. Using a) and R how can

x and y vectors for this circle be obtained? For now, use R=5.

Hint: what are the equations for x and y?

d) Edit the script so the circle is plotted, is the result as expected? What can be done to

improve the results?

e) Create a new function called circ. The input for this function is R and the outputs of the

function the X and Y (these variables will be vectors). Use a) and c) for the proper equations.

f)

In the command window, use the circ function. (e.g. circ(5) ). By using only the command

window and the circ function, create X and Y values in the workspace and plot the results.

Hint: this will take 2 commands.

g) Edit the script created previously so it uses the function circ instead of manually creating the

X and Y vectors.

h) Using the Mathworks help page: what is the command for retaining multiple plots in a single

window? Also see the examples given on the page to get an idea on how to use the

command.

i)

Using the answer from g) and the circ function created. Change the script created that plots

2 circles with different radius in a single window.

5. Got it!

Matlab is very fast in many equations at once due to the usage of matrices and vectors. In this

exercise this set of equations will be solved using Matlab:

2 + 10 + 11 = 327

6 + + 11 = 286

14 + 13 + 6 = 229

12 + 14 + 10 = 332

14 + 10 + 3 = 139

&' = (

With & as matrix and ( and ' as vectors. Whereas the vector ' is equal to )*.

a) Insert the matrix & and vector ( in Matlab. What should the sizes of these variables be?

One way to solve this is retrieving the row reduced echelon form of the matrix .

b) What is the command for retrieving this form in Matlab? Use the mathworks help.

c) Use the command on the matrix [& (]. What are the answers for , and ?

d) Verify these results by constructing the vector ' and calculating the vector (. Should the *

or the .* command be used? Why?

A other way to solve this set of equations is by using the mldivide command

e) The mldivide has a shorter notation. What is this notation?

f) Solve the equations using the mldivide command.

Matlab has a lot of commands to solve this set of equations.

g) Search the help for mldivide for another command to solve this system.

- Tutorial DynareUploaded byKenn
- cfnseUploaded byadhishor
- Matlab Assignment-01 SEM-II-2016-2017.pdfUploaded byfarhanfendi
- Lab 1Uploaded bykiskfk
- Matlab Part 4 Modeling and SimulationUploaded byreza rahmad
- Machine Learning Course Handwriting RecognitionUploaded byJoshuaDownes
- Assignment01-dspUploaded byfarooqhasan
- hmw1Uploaded byJaewon Jung
- Week 5 Distributed Data Management Presentation - Part2 (1)Uploaded bylalit chaudhary
- MATLAB Assignment Help UKUploaded bysidhant gupta
- DSP--LAB#01Uploaded byAwais Bashir
- Matlab TutorialUploaded byThuy Phan
- Main c Matlap v1.3Uploaded byManh Nguyen
- Robot Control Through GesturesUploaded byAmit Huda
- Electromagnetic Scattering by. Stratified InhomogeneousmediaUploaded byMahesh Raja
- Embedded MATLABUploaded byDhanya Ramaswamy
- Matlab_Vis3D_BKaus.pdfUploaded byfestau
- Adopt Al Alg and Trig 2012 Analytical Math Sullivan FinalUploaded byHasen Bebba
- MatrixReview.rUploaded byJose C Beraun Tapia
- Matlab NotesUploaded byBjarki Már Stefánsson
- Lecture 2 Part 1Uploaded byjhonnyb909
- C8BD2C3Cd01Uploaded byItalo Chiarella
- 3 ENGALG2 Matrix Algebra.pdfUploaded byIsaiah Pinto
- Introduction to Matlab.pptUploaded byrafesh
- Linear Algebra Spring 2015Uploaded bysofi
- CHAPTER 1Uploaded byMohd Ikhwan
- Concept OsioUploaded byGerardo Tejeda
- MATLab ManualUploaded byVenkadeshwaran Kuthalingam
- ftryUploaded byAnn Fee
- lec14np.pdfUploaded byakshay

- Economic Order QuantityUploaded byNaoman Ch
- HP 49G RPL.pdfUploaded byChristian D. Orbe
- STPM Mathematics T Questions For RevisionUploaded byKHKwong
- im_ch01Uploaded byStefan Svärd
- Trigonometric RatiosUploaded byABDUL RAUF
- Maths IYearUploaded bySiswanto Smandapa Oke
- 28_3_orthog_curv_coords.pdfUploaded byPortgas D Ace
- 2. Metallurgical - Ijmmse - Drilling Optimization Using - Farshad Nejad ShahmohammadUploaded byTJPRC Publications
- vol1-28-13Uploaded bymaleckisale
- Joel Thorarinson and Marcelo Gleiser- Dynamical Emergence of Complex Structures in Field TheoriesUploaded byPomac232
- 1st Meeting Quantities and UnitsUploaded byAnindito Adi Wicaksono
- Sample SolutionsUploaded byChinna Durai
- EE 150 Lecture 4 Slides [Hadamard]Uploaded byskippy16
- Differential EquationsUploaded byNabill Ashraf
- Michael Luke Relativistic and Non-Relativistic Quantum MechanicsUploaded byeudeba1qaz
- Object Tracking Using Radial Basis Function NetworksUploaded byrickeshtn
- STAT 230 Course Notes Fall 2019Uploaded byBrennan Wong
- Statistical Methods in Credit RatingUploaded byksuresh179
- CATIAUploaded byanon_188037793
- Chapter 14 ADD MATHSUploaded byChrystal Brown
- Anthony F. Russell-Logic, Philosophy, and History. A Study in the Philosophy of History Based on the Work of R. G. Collingwood-University Press of America Inc. (1984).pdfUploaded bytri korne penal
- Chapter-2-mathematical-models-of-systems (1).pptxUploaded byHassan Allawi
- Eigenvalues dfdUploaded bychfakht
- Adaptive Control UnitIUploaded byPavaman
- Solving Inverse Kinematic 2dUploaded byPhi Vo
- Von Mises CriterionUploaded byLauren Jackson
- Fundamental MathsUploaded byzuhair
- utk_notes.pdfUploaded bykyva1929
- Gis Modeling FrameworkUploaded byLuis Car Paniagua
- Data Mining and Knowledge Discovery via Logic-Based Methods_ Theory, Algorithms, And Applications [Triantaphyllou 2010-06-28]Uploaded bytruekhan