Borrar filtros
Borrar filtros

inv Matrix must be square

2 visualizaciones (últimos 30 días)
Naema
Naema el 20 de Jun. de 2014
Comentada: Andrew el 21 de Jun. de 2014
how to invert alpha in the following relation.so if alpha values are from 3 to 11 with 50 steps (size of alpha is "1x50"), how can do the following:
r=log(0.001)./(-inv(alpha));
I got the following error: Error using ==> inv Matrix must be square.
  1 comentario
Matt J
Matt J el 20 de Jun. de 2014
It is not clear what operation you're trying to achieve. Since alpha is not square, inv(alpha) is indeed undefined.

Iniciar sesión para comentar.

Respuestas (1)

Andrew
Andrew el 20 de Jun. de 2014
Editada: Andrew el 20 de Jun. de 2014
Naema, what do you mean by inverse? If you want the element wise inverse such as
1/alpha_ij
then you would use
r=log(0.001)./(-(alpha.^(-1));
If you want alpha flipped, as in you defined alpha as linspace(3,11,50) but actually want linspace(11,3,50) then you can use the fliplr function like this:
r=log(0.001)./(-fliplr(alpha))
If you want the matrix inverse of alpha, well that's impossible to actually find (you can do some funny things with pseudo inverses but they're not real inverses).
Hope one of these is what you are looking for.
Andrew
  8 comentarios
Naema
Naema el 20 de Jun. de 2014
by the way, the plot command can be: plot(h_Au,l10,'r','linewidth',2); or: plot(h_Au,r10,'r','linewidth',2); please let me know what happens with you asaaaap! thanks, Naema
Andrew
Andrew el 21 de Jun. de 2014
Hey, so the issue is in the r10 line.
you need to add dots to make it
r10=(1-exp(-fliplr(alpha)*(2*pi())/1310e-9).*l10).*a;
However you still have a problem because the data you have is generating INF values from this code because the exponents are too large. Unfortunately that's not something I can help you with. You probably have a typo in your code or have misinterpreted an equation, so you'll have to check that out.
Sorry for the late response. I got sidetracked by somehting.
Andrew

Iniciar sesión para comentar.

Categorías

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