Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: gradient error
Replies: 5   Last Post: Jan 12, 2013 4:03 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 7,891
Registered: 6/7/07
Re: gradient error
Posted: Jan 12, 2013 1:56 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/12/2013 12:49 PM, ben wrote:
...
> a = [32 45 54]
>
> When I use the gradient function as follows , I get no errors from Matlab:
>

>>> gradient(a);
>
> ans =
>
> 13 11 9
>
> But I want the dF/dx and dF/dy components from the gradient , but I get
> the follwoinf error:
>

>>> [Fx, Fy] = gradient(a);
> Error in ==> gradient at 49
...

To get a 2D gradient returned the input must be at least 2D, not a
vector only.

--




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.