default_test

PURPOSE ^

UNTITLED2 This is a simple test if Plot ID works for the default settings

SYNOPSIS ^

function [result] = default_test()

DESCRIPTION ^

UNTITLED2 This is a simple test if Plot ID works for the default settings
   Detailed explanation goes here

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [result] = default_test()
0002 %UNTITLED2 This is a simple test if Plot ID works for the default settings
0003 %   Detailed explanation goes here
0004 
0005 clear; clc; close all;
0006 addpath('./fcn_core','./fcn_help');
0007 
0008 ProjectID = 'Test01';
0009 %% Data
0010 % some random data
0011 x = linspace(0,7);
0012 y = rand(1,100)+2;
0013 dataset1 = 'test_data.mat';
0014 save('CI_files/test_data.mat','x','y');
0015 % some data as .h5
0016 x1 = linspace(0,2*pi);
0017 y1 = sin(x1)+2;
0018 
0019 % define file path & name
0020 fpath = "CI_files/testdata_2.h5";
0021 dataset2 = 'testdata_2.h5';
0022 
0023 % create hdf5 file and dataset > write data to hdf5 file / dataset
0024 h5create(fpath, "/x1", size(x1), "Datatype", class(x1))
0025 h5create(fpath, "/y1", size(y1), "Datatype", class(y1))
0026 h5write(fpath, "/x1", x1)
0027 h5write(fpath, "/y1", y1)
0028 
0029 %% Plotting
0030 
0031 fig(1) =figure('visible','off');
0032 plot(x,y,'-k');
0033 hold on
0034 plot(x1,y1,'-r');
0035 
0036 %% Tag the plot
0037 try
0038     [figs, ID] = TagPlot(fig, ProjectID);
0039 
0040     %% call a dummy function
0041     a=1;
0042     a = example_fcn(a);
0043 
0044     %% publishing
0045 
0046     % The functions needs the file location, the location of the data and the
0047     % figure
0048     path.script = mfilename('fullpath'); % filename of the m.script
0049 
0050     % file name of the data
0051     path.rdata =  {dataset1,dataset2} ; % don't forget the extension
0052 
0053     Publish(path, ID, figs, 'Location', 'CI-Test')
0054     
0055     % clean up
0056     delete CI_files/export/* CI_files/*.mat CI_files/*.h5 
0057     rmdir('CI_files/export','s'); 
0058     result = true;
0059     clc;
0060 catch
0061     result = false;
0062     warning('simple_test failed');
0063 end
0064 
0065 end
0066

Generated on Tue 03-Aug-2021 18:32:18 by m2html © 2005