how to apply a power function to all elements of matrix?

3 visualizaciones (últimos 30 días)
sai shashidhar nagabandi
sai shashidhar nagabandi el 7 de Oct. de 2018
Comentada: sai shashidhar nagabandi el 7 de Oct. de 2018
I have a matrix R, and I wish to apply a power function to all elements of that matrix. The coefficients of that function a,b,c are in an array [a b c].
I guess I can't use Polyval as its for polynomials. I wish I could use arrayfunc BUT, my a,b,c values change for my every matrix R (I have about 50 diff R matrices). So even if I did arrayfunc(defined_powerfunc,R) I don't get how I'll send the a,b,c values to it.
Please let me know how to solve this problem, thanks!
  2 comentarios
James Tursa
James Tursa el 7 de Oct. de 2018
Please post a short example of inputs and desired output.
sai shashidhar nagabandi
sai shashidhar nagabandi el 7 de Oct. de 2018
hello James so the matrix is something like
A = [1 2 3; 4 5 6; 7 8 9] and a power function looks like y = a*(x^b) + c. I wish to apply this transformation to all elements of A. (Here x is values of A)
I just figured why not do a.*(A.^b) + c simply! Hope that works, I just got lost in trying to find something like polyval. Thanks!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB 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!

Translated by