Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

write a matlab function

1 visualización (últimos 30 días)
Nienke Rook
Nienke Rook el 7 de Oct. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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?

Respuestas (1)

M
M el 7 de Oct. de 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.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by