user2208374
user2208374

Reputation: 19

How do you calculate the path by removing the current file name from the full path, in Matlab?

How do you calculate the path by removing the current file name from the full path? I have this so far:

fullPath = mfilename('fullpath')
curMfile = mfilename();
path = 

But I don't know what to put for path.

Upvotes: 2

Views: 217

Answers (1)

Molly
Molly

Reputation: 13610

You can use [pathstr, name, ext] = fileparts(filename)

Upvotes: 5

Related Questions