Matrix cos. Did I write the expression and correctly?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuesta aceptada
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
0 comentarios
Más respuestas (1)
Steven Lord
el 28 de Sept. de 2020
You can check your answer using the funm function in MATLAB.
0 comentarios
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!