Matrix cos. Did I write the expression and correctly?

1 visualización (últimos 30 días)
Argus l
Argus l el 28 de Sept. de 2020
Respondida: Steven Lord el 28 de Sept. de 2020
function M = cosM(A)
M=A;
for i=0:1:100
M=M-(-1)^i*A^(1*i+1)
end
end

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 28 de Sept. de 2020
Editada: Ameer Hamza el 28 de Sept. de 2020
It should be something like this
function M = cosM(A)
M=E; % I don't know how E is defined in that equation
for k=1:1:100
M=M+(-1)^k*A.^(2*k)/factorial(2*k);
end
end

Más respuestas (1)

Steven Lord
Steven Lord el 28 de Sept. de 2020
You can check your answer using the funm function in MATLAB.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by