Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Help with MatLab

  • 07-11-2006 5:18pm
    #1
    Closed Accounts Posts: 2,178 ✭✭✭


    Hey eveybody
    I'm new to Matlab but will be using it alot from now on. Unfortunately I've come up against a problem pretty quickly. I'm trying to calculate the gradient of a matrix but all I get is:

    ??? Attempt to execute SCRIPT gradient as a function.

    Now I've tried copying the example of the use of the gradient function from Help directly into the .m* file but this results in the same message.

    Here is what the relevant piece of code from the .m* file looks like so far:

    x = -1:0.4:1
    y = -1:0.4:1

    [X,Y] = meshgrid(x,y)

    Q = atan2(Y,X)
    mesh (Q)

    [pQ] = gradient(Q)


    It will put the marix into the mesh figure as wanted but will not do anything with the gradient. I think the answer should come out as a vector but I'm not sure.
    Any help will be greatly appreciated.


Advertisement