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

Thread Subject:
New to Matlab and I'm Stuck

Subject: New to Matlab and I'm Stuck

From: Clay

Date: 31 Oct, 2010 20:39:03

Message: 1 of 2

As an assignment I have to compute the magnitude of the impedance of a circuit as a function of the inductive load.

So it is just a resistor and inductor in parallel. The R=10 and the XL fluctuates between 1 and 50 ohms. Right now I have

R=10
XL=[1:0.2:50];
Vm=120

and when I try to compute the equivalent equivalent impedance I get an error
??? Error using ==> mpower
Inputs must be a scalar and a square matrix.

Error in ==> Handout2 at 21

Zeq= (R+XL)/(sqrt(R^2+XL^2))

Zeq= (R+XL)/(sqrt(R^2+XL^2))

Shouldn't this allow me to get the Equivalent Impedance as a fn of the Inductive load? Any help would be appreciated.

Subject: New to Matlab and I'm Stuck

From: Miroslav Balda

Date: 31 Oct, 2010 21:23:04

Message: 2 of 2

"Clay " <Paintball057@gmail.com> wrote in message <iakk57$duv$1@fred.mathworks.com>...
> As an assignment I have to compute the magnitude of the impedance of a circuit as a function of the inductive load.
>
> So it is just a resistor and inductor in parallel. The R=10 and the XL fluctuates between 1 and 50 ohms. Right now I have
>
> R=10
> XL=[1:0.2:50];
> Vm=120
>
> and when I try to compute the equivalent equivalent impedance I get an error
> ??? Error using ==> mpower
> Inputs must be a scalar and a square matrix.
>
> Error in ==> Handout2 at 21
>
> Zeq= (R+XL)/(sqrt(R^2+XL^2))
>
> Zeq= (R+XL)/(sqrt(R^2+XL^2))
>
> Shouldn't this allow me to get the Equivalent Impedance as a fn of the Inductive load? Any help would be appreciated.

Hi,
Your command can not work because of two errors:
1. XL is a vector. You have to make division term by term using the array operator "./"
2. The same holds for a power operator. Use ".^".
thus, your command should be read as
    Zeq= (R+XL)./(sqrt(R^2+XL.^2))
Mira

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