new app2: changed the way data is stored and accessed, better gui, added data manipulation via external functions

This commit is contained in:
v.chau 2025-07-21 13:27:44 +02:00
parent bc3890b713
commit 4c6deca018
4 changed files with 26 additions and 0 deletions

BIN
app2.mlapp Normal file

Binary file not shown.

5
functions/SLS_FL.m Normal file
View File

@ -0,0 +1,5 @@
function [names, weg, kraft] = SLS_FL(voltage)
names = ["Weg_FL", "Kraft_FL"];
kraft = (voltage/1000 - (2.073 - 200 * (-0.104/1800)))/(-0.104/1800);
weg = (voltage/1000 - (1.969 - 0.38 * (-0.111/0.38)))/(-0.111/0.38);
end

16
functions/example.m Normal file
View File

@ -0,0 +1,16 @@
function [NameOfOutput, Output1, Output2] = example(data)
% explanation
% data is double with the length of the timetable
% you can add any number of datasets to your function be clicking them in the "Choose Data Sets to use" Field
% Datasets will be input in the same order as you clicked them
% you can add more inputs into your function by typing something like this [NameOfOutput, Output, NameOfOutput2, Output2] = example(data, data2, data3), same with outputs
% keep the sequence of name, output, name output, otherwise there will be errors
% if exported to workspace the output can be viewed in data_created with the column title NameOfOutput
% NameOfOutput will be displayed in the app, as well as in in data_created exports
% reminder that the inputs and outputs after function [outputs] = functionname(inputs) must be declared somewhere in the function
% if you want to test your function you can export the data and use the function outside of the app with the terminal
NameOfOutput = ["Output 1" "RandomName"]; % don't use ,
Output1 = data * 2; %output should be a double with same length as your data
Output2 = data * 1/2;
end

5
functions/test.m Normal file
View File

@ -0,0 +1,5 @@
function [names, data, data2] = test(abc, def)
names = ["Data1" "Data2"];
data = abc*2;
data2 = def*3;
end