matrix exponential's, both base and exponent are matrix

Hi, Is there are simple way to find the exponential when both base and exponent are matrices. Currently I am using a loop.

Respuestas (1)

If the matrices are the same size and you want to take corresponding elements, then use
base.^exponent

6 comentarios

Preethi
Preethi el 31 de Ag. de 2015
if the matrices are of different size?
Are they vectors or are they matrices? What size() should the output be?
result = reshape(bsxfun(@power, base(:), exponent(:).'), [size(base),size(exponent)]);
for example, 3 x 5 and 2 x 2 would come out as 3 x 5 x 2 x 2
What meaning would you put to a case where you try to raise a 3x3 matrix to a 2x2 exponent? How could that possibly make sense?
I don't know, John, but there's probably an application for it in String Theory anyhow ;-)
I tried reading about string theory once, but I kept losing the thread. I got all tangled up in knots.

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 31 de Ag. de 2015

Comentada:

el 31 de Ag. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by