Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Error using ==> mpower Matrix must be square.

Subject: Error using ==> mpower Matrix must be square.

From: borja

Date: 15 Jun, 2014 15:39:08

Message: 1 of 3

using this code:

n1=linspace(0,20,20);
            d1=10;
            nn=(n1+2)/(n1+1)-0.46
            L=37+30*log10(d1)+18.3*n1^nn;
            
            subplot 211
            plot(n1,L)
            title('Pérdidas en función de los pisos para d min')
            xlabel('pisos')
            ylabel('pérdidas (dB)')

i become the problem: Error using ==> mpower Matrix must be square.

Could you help me?

thanks

Subject: Error using ==> mpower Matrix must be square.

From: Roger Stafford

Date: 15 Jun, 2014 22:15:08

Message: 2 of 3

"borja " <etsib@ehu.es> wrote in message <lnkemr$7s1$1@newscl01ah.mathworks.com>...
> .......
> L=37+30*log10(d1)+18.3*n1^nn;
> .......
- - - - - - - - -
  I suspect what you are missing is the 'dot' in "18.3*n1^nn", which presumably should be "18.3*n1.^nn" . Without the 'dot' the indicated operation is to take a matrix power which requires a square matrix, and 'n1' is not square. With the 'dot', the operation takes the 'nn' power of each individual element of 'n1' and that does not require that 'n1' be square.

Roger Stafford

Subject: Error using ==> mpower Matrix must be square.

From: Bruno Luong

Date: 16 Jun, 2014 07:35:16

Message: 3 of 3

I also suspect that nn should be
nn=(n1+2)./(n1+1)-0.46

I double OP would set nn as a least-square regression of n1+2 from n1+1

Bruno

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us