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

New to MATLAB?

Thread Subject:
relative and absolute path problems

Subject: relative and absolute path problems

From: Mateusz Gos

Date: 16 Nov, 2010 18:44:04

Message: 1 of 2


I simply have no idea how to tackle this (whether it is possible), so any help will be greatly appreciated.
I have got an exe file compiled from a number of m files and mex file using matlab mcc command. When running the exe file it calls mex a couple of times. Mex in turn calls some external, separate files containing required parameters. It all works fine on my machine.
Problems starts when you run the exe kernel in the on a different machine, under a C interface which I believe creates a temp directory for the kernel (someone else designed the interface). The mex file cannot locate the folder with external files anymore and kernel crashes after running from the user interface.
I though I should change the path in mex gateway function (f90) to something else but (perhaps an absolute rather than relative path??) but these are just guesses. I suppose ideally I should make the folder with externel files part of the exe, but then how to point the directory to 'itself'...


Subject: relative and absolute path problems

From: ImageAnalyst

Date: 17 Nov, 2010 00:32:44

Message: 2 of 2

What do you mean by "under a C interface"?

What operating system are you using?

Are you using a startup.m file? This gets run when you compile an m-
file and run it.

Try printing out mfilename, pwd, and ctfroot in your opening function
to see what they say.

Have you looked at sections 3.10 and 3.11 of the FAQ?

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