1

I have created a function in MATLAB & have saved it as an m file. When I run my function, it's fine. However using the Windows 7 scheduler it goes to run my function and gives the error message 'Undefined variable 'myMethod' or function 'myMethod.m'.

When I run the which('myMethod.m') it returns the correct folder so not sure what this error message is about?

The pwd method returns the correct address of where my function is too, C:\SomeFolder\MATLAB\Me

1 Answer 1

1

Probably its simply not finding the function because it is not on the path. Assuming you can run builtin functions via the scheduler, try something like this:

p = path
save p
% save c:\ p

In case you cannot even find the saved file, use the last line instead.

Match the path with your files location and presumably the path does not contain the folder which holds your file.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Dennis, thanks for the reply. Just found that in the Edit Action section of the windows scheduler that the command -r myFunction should not have the .m file extension. Bit strange but now runs
@mHelpMe You saved my mental sanity. THANKS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.