Info

此问题已关闭。 请重新打开它进行编辑或回答。

write a matlab function

2 次查看(过去 30 天)
Nienke Rook
Nienke Rook 2017-10-7
关闭: MATLAB Answer Bot 2021-8-20
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?

回答(1 个)

M
M 2017-10-7
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.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by