example

PURPOSE ^

test skript

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 test skript

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % test skript
0002 clear; clc; close all;
0003 addpath('fcn_core','fcn_help');
0004 addpath('CI_files'); % Test scripts
0005 
0006 try
0007     delete testdata_2.h5;
0008 end
0009 
0010 ProjectID = 'JL01';
0011 %% Data
0012 % some random data
0013 
0014 x = linspace(0,7);
0015 y = rand(1,100)+2;
0016 dataset1 = 'test_data.mat';
0017 save('test_data.mat','x','y');
0018 
0019 
0020 % some data as .h5
0021 x1 = linspace(0,2*pi);
0022 y1 = sin(x1)+2;
0023 
0024 % define file path & name
0025 fpath = "./testdata_2.h5";
0026 dataset2 = 'testdata_2.h5';
0027 
0028 % create hdf5 file and dataset > write data to hdf5 file / dataset
0029 h5create(fpath, "/x1", size(x1), "Datatype", class(x1))
0030 h5create(fpath, "/y1", size(y1), "Datatype", class(y1))
0031 h5write(fpath, "/x1", x1)
0032 h5write(fpath, "/y1", y1)
0033 
0034 %% Plotting
0035 
0036 fig(1) =figure;
0037 plot(x,y,'-k');
0038 box off
0039 set(gca, 'TickDir', 'out', 'YLim', [0,4]);
0040 
0041 hold on
0042 %fig(2) =figure;
0043 plot(x1,y1,'-r');
0044 set(gca, 'TickDir', 'out', 'YLim', [0,4]);
0045 %% Tag the plot
0046 [figs, ID] = TagPlot(fig, ProjectID);
0047 
0048 %% call a dummy function
0049 a=1;
0050 a = example_fcn(a);
0051 
0052 %% publishing
0053 
0054 % The functions needs the file location, the location of the data and the
0055 % figure
0056 path.script = mfilename('fullpath'); % filename of the m.script
0057 
0058 % file name of the data
0059 path.rdata =  {dataset1,dataset2} ; % don't forget the extension
0060 
0061 Publish(path, ID, figs, 'Location', 'local','Method','individual')
0062 
0063 %% Second Plot with identical data to test centralized method
0064 %
0065 % fig2 =figure;
0066 % plot(x,y,'-k');
0067 % hold on
0068 % plot(x1,y1,'-r');
0069 %
0070 % [fig2, ID] = TagPlot(fig2, ProjectID);
0071 %
0072 % Publish(path, ID, fig2, 'Location', 'local','Method','centraliced')

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