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:
Please Help!

Subject: Please Help!

From: Kevin Ellis

Date: 30 Nov, 2010 03:24:05

Message: 1 of 7

Hello,

I'm not very adept at using MatLab and have been struggling with this problem for hours now. I have two equations I am trying to solve for I and V (Current and Voltage):

I = Il-Io*(exp((V+I*Rs)/a)-1)
V = (Mp*I*Rl)/Ms

I have tried to set up a while loop and graphically solve the equations, however, I can't get past the same error:

??? Undefined function or method
'intercept' for input arguments of type
'double'.

Error in ==> Pleasework at 21
    ind_Inew=intercept(I,eq1,eq2);

Here is my code that I'm using:

%Enter the given variables
Mp=4;
Ms=2;
Rs=0.533;
a=1.005;
Il=4.543;
Io=2.353*10^-9;
Rl=6;
    
%Solve for V and I
V_start=10; %Initial guess for V
change=1;
V=V_start;
        
while change>0.001
    %Graphically solve the first equation
    I=0.01:0.0001:10;
    eq1=Il-Io*(exp((V+I*Rs)/a)-1);
    eq2=I;
    
    ind_I=intercept(I,eq1,eq2);
    I=I(ind_I);
    
    %Graphically solve the second equation
    V=2:0.0001:40;
    eq1=(Mp*I*Rl)/Ms;
    eq2=V;
    
    ind_V=intercept(V,eq2,eq1);
    V=V(ind_V);
    change=abs(V-V_start);
    V_start=V;
end
    
    V
    I

Any help would be much appreciated. I have been struggling on this problem for awhile now. Thanks.

Kevin

Subject: Please Help!

From: ImageAnalyst

Date: 30 Nov, 2010 03:32:32

Message: 2 of 7

Kevin:
intercept is probably a function in a toolbox that you do not have
installed. Type "ver" on the command line to see what toolboxes you
have. Then report what it says back here. I don't have intercept
either but someone who does will probably tell you what toolbox it is
in.

Subject: Please Help!

From: Kevin Ellis

Date: 30 Nov, 2010 03:50:06

Message: 3 of 7

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <0ba47e60-f630-4f10-816f-1aa73ea08f90@p1g2000yqm.googlegroups.com>...
> Kevin:
> intercept is probably a function in a toolbox that you do not have
> installed. Type "ver" on the command line to see what toolboxes you
> have. Then report what it says back here. I don't have intercept
> either but someone who does will probably tell you what toolbox it is
> in.

Okay here is what it says. I hope this helps:

>> ver
-------------------------------------------------------------------------------------
MATLAB Version 7.11.0.584 (R2010b)
MATLAB License Number: 660172
Operating System: Microsoft Windows 7 Version 6.1 (Build 7600)
Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.11 (R2010b)
Symbolic Math Toolbox Version 5.5 (R2010b)
>>

Subject: Please Help!

From: ImageAnalyst

Date: 30 Nov, 2010 04:02:07

Message: 4 of 7

Well, intercept is not a function in the Symbolic Math Toolbox (http://
www.mathworks.com/help/toolbox/symbolic/bqs6eui.html#I)
Where did you get that code? Is a custom-written function? Can you
use polyfit and polyval instead?

Subject: Please Help!

From: TideMan

Date: 30 Nov, 2010 04:10:37

Message: 5 of 7

On Nov 30, 4:50 pm, "Kevin Ellis" <kevin.elli...@gmail.com> wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <0ba47e60-f630-4f10-816f-1aa73ea08...@p1g2000yqm.googlegroups.com>...
> > Kevin:
> > intercept is probably a function in a toolbox that you do not have
> > installed.  Type "ver" on the command line to see what toolboxes you
> > have.  Then report what it says back here.  I don't have intercept
> > either but someone who does will probably tell you what toolbox it is
> > in.
>
> Okay here is what it says. I hope this helps:
>
> >> ver
>
> -------------------------------------------------------------------------------------
> MATLAB Version 7.11.0.584 (R2010b)
> MATLAB License Number: 660172
> Operating System: Microsoft Windows 7 Version 6.1 (Build 7600)
> Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
> -------------------------------------------------------------------------------------
> MATLAB                                                Version 7.11       (R2010b)
> Symbolic Math Toolbox                                 Version 5.5        (R2010b)
>
>

There are a couple of things wrong with your posts:
1. The subject is silly. Most people will ignore a thread called
"Please Help!", so you will probably miss out getting help from the
people who could recognise your problem. People will be more likely
to respond to a title like: "Function intercept missing" or similar.
2. Top posting is bad manners. It makes the thread hard to follow.
Put your reply UNDERNEATH.

Where did you get the notion to use the function intercept?
Clearly, it does not exist on your path, yet you have used it.
You will have to locate it. We cannot help with that.

Subject: Please Help!

From: Kevin Ellis

Date: 30 Nov, 2010 04:15:05

Message: 6 of 7

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a20dfd24-be2a-45d3-a869-42885fbc3a80@i18g2000yqn.googlegroups.com>...
> Well, intercept is not a function in the Symbolic Math Toolbox (http://
> www.mathworks.com/help/toolbox/symbolic/bqs6eui.html#I)
> Where did you get that code? Is a custom-written function? Can you
> use polyfit and polyval instead?

Its a custom written function. I had just wanted to find the intercept between the two equations and have the while function iterate until a solution is found.

Subject: Please Help!

From: Kevin Ellis

Date: 30 Nov, 2010 04:24:04

Message: 7 of 7

TideMan <mulgor@gmail.com> wrote in message <3e1923f2-ac31-44df-b066-434ad2e4a745@37g2000prx.googlegroups.com>...
> On Nov 30, 4:50 pm, "Kevin Ellis" <kevin.elli...@gmail.com> wrote:
> > ImageAnalyst <imageanal...@mailinator.com> wrote in message <0ba47e60-f630-4f10-816f-1aa73ea08...@p1g2000yqm.googlegroups.com>...
> > > Kevin:
> > > intercept is probably a function in a toolbox that you do not have
> > > installed.  Type "ver" on the command line to see what toolboxes you
> > > have.  Then report what it says back here.  I don't have intercept
> > > either but someone who does will probably tell you what toolbox it is
> > > in.
> >
> > Okay here is what it says. I hope this helps:
> >
> > >> ver
> >
> > -------------------------------------------------------------------------------------
> > MATLAB Version 7.11.0.584 (R2010b)
> > MATLAB License Number: 660172
> > Operating System: Microsoft Windows 7 Version 6.1 (Build 7600)
> > Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
> > -------------------------------------------------------------------------------------
> > MATLAB                                                Version 7.11       (R2010b)
> > Symbolic Math Toolbox                                 Version 5.5        (R2010b)
> >
> >
>
> There are a couple of things wrong with your posts:
> 1. The subject is silly. Most people will ignore a thread called
> "Please Help!", so you will probably miss out getting help from the
> people who could recognise your problem. People will be more likely
> to respond to a title like: "Function intercept missing" or similar.
> 2. Top posting is bad manners. It makes the thread hard to follow.
> Put your reply UNDERNEATH.
>
> Where did you get the notion to use the function intercept?
> Clearly, it does not exist on your path, yet you have used it.
> You will have to locate it. We cannot help with that.

Sorry Tideman,

This is my first post on this website. I guess I didn't understand the proper protocol. Despite that I figured it out after you pointed out that the function intercept had not been properly defined beforehand.

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