Thread Subject: symbolic partials

Subject: symbolic partials

From: Steve

Date: 12 Oct, 2007 20:08:38

Message: 1 of 4

How do I take a partial derivative of a function with
symbols? For example, when I try
f=x*y
diff(x,'y')
I just get zero. Any suggestions?

Thanks.

Subject: symbolic partials

From: carlos lopez

Date: 12 Oct, 2007 20:17:46

Message: 2 of 4

"Steve " <steveDEL.bachmeierDEL@yahoo.com> wrote in message
<feok86$hqa$1@fred.mathworks.com>...
> How do I take a partial derivative of a function with
> symbols? For example, when I try
> f=x*y
> diff(x,'y')
Maybe you are trying to produce
diff(x,'f')
instead
Regards
Carlos

Subject: symbolic partials

From: Steve

Date: 12 Oct, 2007 20:36:14

Message: 3 of 4

Oops, I meant that diff(f,'x') gives me zero. So,

f=x*y
diff(f,'x')
ans=0

I'm looking for
ans=y

Ideas?

"carlos lopez" <clv2clv_00000000_@adinet.com.uy> wrote in
message <feokpa$4g$1@fred.mathworks.com>...
> "Steve " <steveDEL.bachmeierDEL@yahoo.com> wrote in message
> <feok86$hqa$1@fred.mathworks.com>...
> > How do I take a partial derivative of a function with
> > symbols? For example, when I try
> > f=x*y
> > diff(x,'y')
> Maybe you are trying to produce
> diff(x,'f')
> instead
> Regards
> Carlos
>

Subject: symbolic partials

From: carlos lopez

Date: 1 Nov, 2007 20:47:00

Message: 4 of 4

x = sym('x');
t = sym('t');
f=x*t;
diff(f,'t')
ans =
x
Apparently you did not declare the terms as "sym"
Hope this helps
Carlos

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
pde Ned Gulley 12 Oct, 2007 17:43:12
symbolic Ned Gulley 12 Oct, 2007 17:43:12
partial derivat... Steve 12 Oct, 2007 16:10:24
symbolic toolbox Steve 12 Oct, 2007 16:10:23
rssFeed for this Thread

Contact us at files@mathworks.com