Info

This question is closed. Reopen it to edit or answer.

write a matlab function

3 views (last 30 days)
Nienke Rook
Nienke Rook on 7 Oct 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
Consider the iterative process; Xn+1 = AXn, n= 0,1,... where; A = rSRS^-1 , r = 0,97, a= 0.04pi, s = [ 1 1,0 1] (matrix 2*2) , R = [cos(a) -sin(a), sin(a) cos(a)] (matrix 2*2) , X0=[10,6] (matrix 1*1) Write a Matlab function with the following declaration: function X = exercise4(v) where the input argument is the vector v. The function should implement the iterative process an return the output in the matrix X: the first row of X is X0^T, the second row is x1^T, and so on. The iterative process should stop when the norm Xn = sqrt(Xn^T*Xn) is smaller than 0.01. The final number of iterations should be displayed in the command window executing the function (and hence also in the published ouput). It is not necessary to display X. Finally, the function should plot the path in R^2 obtained by the sequence of all iterates, starting from X0 until the last point.
Can someone help me with this exercise?

Answers (1)

M
M on 7 Oct 2017
Hello,
Maybe you could show us what you already tried ?
You can find some help on how to declare a function here : https://fr.mathworks.com/help/matlab/ref/function.html
It may help to write the function without 'Matlab-language' first.

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!