diff --git a/+PlotID/Publish.m b/+PlotID/Publish.m index f134cc04ea24c06c6e8b92b3072cdd93627d1f23..ce254fb5430de6dfb142f0067334cb3525eb4d4b 100644 --- a/+PlotID/Publish.m +++ b/+PlotID/Publish.m @@ -27,7 +27,7 @@ function Publish(DataPaths,scriptPath, figure, options) arguments DataPaths {mustBeDataPath} % location of the data-file(s) - scriptPath (1,:) {mustBeFile} % location of the matlab script + scriptPath (1,:) {mustBeText} % location of the matlab script figure (1,:) {mustBeFigure} % Checks if figure is a figure object options.Location {mustBeMember(options.Location ,{'local','server','manual','CI-Test'})} = 'local' % storage path options.Method {mustBeMember(options.Method ,{'individual','centralized'})} = 'individual' @@ -66,6 +66,11 @@ if numel(figure) > 1 warning(msg); end +% find scriptpath +if ~isfile(scriptPath) + scriptPath= which(['/',scriptPath]); +end + % catch missing .m extension [~,~, scriptExt] = fileparts(scriptPath); if isempty(scriptExt) diff --git a/CHANGELOG.md b/CHANGELOG.md index 555d6ef110bfa065b57b3191075a9e2c5161ae1e..958e507dd6be0839a3492b3676a3a8e26f36cba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,3 @@ # V0.3 -- Add Changelog +- Add changelog +- Add support for file or function name as scriptPath diff --git a/README.md b/README.md index 929ac878932aafd14616caa66ecc8e6cfceb1796..4999db61898459829c6241e3f906936d3d0a8fec 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ The **ProjectID** is your custom project number, it well be the prefix of the ID 2. Publish the plot and the associated data `PlotID.Publish(DataPaths,scriptPath, figure, options)` -`scriptPath` contains the path to the script, this can be provided with the simple call of `scriptPath = [mfilename('fullpath'),'.m']` \ -`DataPaths` contains the path(s) to the research data, for multiple files you can use a cell arrays (they must be at the path). \ +`scriptPath` contains either the path to the script, this can be provided with the simple call of `scriptPath = [mfilename('fullpath'),'.m']` or the script or function name that is used for creating your plot. \ +`DataPaths` contains the path(s) to the research data, for multiple files you can use a cell array (they must be at the path). \ `figure` is the figure that should be published.