Skip to content
Snippets Groups Projects
Commit 97e04981 authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

Add support for file or function name in scriptPath

parent 3af8dc82
No related branches found
No related tags found
2 merge requests!50Draft: FIX bug that causes Error when COPYUSER FCN is off and a broken,!48Add support for file or function name in scriptPath
Pipeline #632535 passed
......@@ -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)
......
# V0.3
- Add Changelog
- Add changelog
- Add support for file or function name as scriptPath
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment