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:
One question about Optimization toolbox

Subject: One question about Optimization toolbox

From: Yi

Date: 2 Jun, 2009 15:15:04

Message: 1 of 4

Hi:

I have one question regarding optimization toolbox.

When I set up my optimization problem using optimization toolbox, for example, GA method, I have to input a fitness function, like @example_1. If in my computer, I have several m.files under different route, this toolbox will pick up which one? In this toolbox, I think it's not allow to set up a path to point to my file. Could anybody tell me how this works? Thanks

Best Regards

Yi

Subject: One question about Optimization toolbox

From: Marcus M. Edvall

Date: 3 Jun, 2009 03:20:25

Message: 2 of 4

The precedence is like this:

1. Current folder you are in.
2. The one that is first in path.

Best wishes, Marcus
Tomlab Optimization Inc.
http://tomopt.com/
http://tomdyn.com/

Subject: One question about Optimization toolbox

From: Yi

Date: 3 Jun, 2009 20:20:16

Message: 3 of 4

Thanks Marcus, one stupid question, I can understand the one taht is first in path, but how to identify the current folder I am in? I should go to open a specific folder? For exampe, I open "c:\Matlab|\...\example1" as a window, and then run that GA toolbox. It will be guaranteed that my GA tool is reading the folder I am open?

Thanks

Yi

"Marcus M. Edvall" <edvall@gmail.com> wrote in message <531dd63a-8fd7-4cd9-a04c-e6f38c0d8fde@e24g2000vbe.googlegroups.com>...
> The precedence is like this:
>
> 1. Current folder you are in.
> 2. The one that is first in path.
>
> Best wishes, Marcus
> Tomlab Optimization Inc.
> http://tomopt.com/
> http://tomdyn.com/

Subject: One question about Optimization toolbox

From: Steven Lord

Date: 3 Jun, 2009 20:51:04

Message: 4 of 4


"Yi " <hvachy@163.com> wrote in message
news:h06lu0$jr7$1@fred.mathworks.com...
> Thanks Marcus, one stupid question, I can understand the one taht is first
> in path, but how to identify the current folder I am in? I should go to
> open a specific folder? For exampe, I open "c:\Matlab|\...\example1" as a
> window, and then run that GA toolbox. It will be guaranteed that my GA
> tool is reading the folder I am open?

We have a description of which version of a function gets called (if you
have multiple functions with the same name) in our documentation:

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f7-58170.html#bresuvu-3

So if you had a function named myobjectivefunction.m in your current working
directory (which you can find using PWD) and another function also named
myobjectivefunction.m somewhere on your path outside the current directory,
a private directory, or a class directory then the one in your current
directory would be used instead of the other one.

--
Steve Lord
slord@mathworks.com

Tags for 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