alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

given command for MATLAB path expansion does not work #38

Closed realsobek closed 7 years ago

realsobek commented 7 years ago

I have an issue with the commands from https://github.com/alecjacobson/gptoolbox#installation :

  1. gp_subdirs = split(genpath('/usr/local/gptoolbox/'),':');
  2. addpath(strjoin(gp_subdirs(~contains(gp_subdirs,'.git')),':')); are given for expansion of MATLAB's path.

Command 1 works fine. Command 2 does not with MATLAB R2016b on a GNU/Linux host. I cannot figure out the problem. Error message is:

Error using catdirs (line 25) All arguments must be character vectors.

Error in addpath (line 63) p = catdirs(mfilename, varargin{1:n});

My workaround, either:

  1. run 'pathtool' and use 'Add with Subfolders...'

or

  1. From command 2 execute: strjoin(gp_subdirs(~contains(gp_subdirs,'.git')),':') That will return a long string, like "/path/to/folder1:/path/to/folder2".
  2. copy and paste the content of the string without the quotation marks (") into the "addpath('')" command, like: addpath('/path/to/folder1:/path/to/folder2')
  3. run the command
alecjacobson commented 7 years ago

On my only Linux machine this worked for me, so I'm not sure exactly what's going on.

The second command is really just remove all the .git type folders so that the path is a bit cleaner. It is not strictly necessary.

Thanks for posting the workaround.

realsobek commented 7 years ago

Further testing revealed:

Case closed.