Month: August 2024
Unable to create mex function ‘XX_Simulinkfunction_sfun.mexw64’ required for simulation.
I am trying to call custom c code in my stateflow and got below error
Making simulation target "XX_Simulinkfunction_sfun", … Microsoft (R) Program Maintenance Utility Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved. NMAKE : fatal error U1065: invalid option ‘-‘ Stop.
Component:Make | Category:Make error
Unable to create mex function ‘XX_Simulinkfunction_sfun.mexw64’ required for simulation.
example.c
#include "example.h"
double busactive(double u1, double u2)
{
double retval;
retval = u1 + u2;
return (retval);
}
example.h
#define TRUE 1
#define FALSE 0
#define MAYBE 2
double busactive(double, double);
added #include "example.h" in simulation target Header file section and example.c is source file section.
using 2018a matlab and MEX configured to use ‘Microsoft Visual C++ 2017 (C)’ for C language compilation.
Could anyone help me solving this issue.I am trying to call custom c code in my stateflow and got below error
Making simulation target "XX_Simulinkfunction_sfun", … Microsoft (R) Program Maintenance Utility Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved. NMAKE : fatal error U1065: invalid option ‘-‘ Stop.
Component:Make | Category:Make error
Unable to create mex function ‘XX_Simulinkfunction_sfun.mexw64’ required for simulation.
example.c
#include "example.h"
double busactive(double u1, double u2)
{
double retval;
retval = u1 + u2;
return (retval);
}
example.h
#define TRUE 1
#define FALSE 0
#define MAYBE 2
double busactive(double, double);
added #include "example.h" in simulation target Header file section and example.c is source file section.
using 2018a matlab and MEX configured to use ‘Microsoft Visual C++ 2017 (C)’ for C language compilation.
Could anyone help me solving this issue. I am trying to call custom c code in my stateflow and got below error
Making simulation target "XX_Simulinkfunction_sfun", … Microsoft (R) Program Maintenance Utility Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved. NMAKE : fatal error U1065: invalid option ‘-‘ Stop.
Component:Make | Category:Make error
Unable to create mex function ‘XX_Simulinkfunction_sfun.mexw64’ required for simulation.
example.c
#include "example.h"
double busactive(double u1, double u2)
{
double retval;
retval = u1 + u2;
return (retval);
}
example.h
#define TRUE 1
#define FALSE 0
#define MAYBE 2
double busactive(double, double);
added #include "example.h" in simulation target Header file section and example.c is source file section.
using 2018a matlab and MEX configured to use ‘Microsoft Visual C++ 2017 (C)’ for C language compilation.
Could anyone help me solving this issue. nmake : fatal error u1065 MATLAB Answers — New Questions
how to configure asp.net.core ihostservice with global exception handler
hi ,I am developing a windows service under asp.net.core 8 as ihostservice , everything is good , but I want to configure global exception handler , I did look to most article on the net , all of them about just asp.net.core or API , ı just need to iho
hi ,I am developing a windows service under asp.net.core 8 as ihostservice , everything is good , but I want to configure global exception handler , I did look to most article on the net , all of them about just asp.net.core or API , ı just need to iho Read More
How to identify a specific avatar. idAvatar?
Hi
I need a kind of “idAvatar” to be able to allow or not allow certain actions. An example: wanting to use VR in the field of education if I am the teacher I can for example use a teleport and the students cannot. Is this possibility? or again if I want to do gamification always for the field of education I should be able to assign game objectives and have a ranking of the participants. I can think of doing it only if I can recover an idAvatar or something like that. How i can do?
Thank you in advance
HiI need a kind of “idAvatar” to be able to allow or not allow certain actions. An example: wanting to use VR in the field of education if I am the teacher I can for example use a teleport and the students cannot. Is this possibility? or again if I want to do gamification always for the field of education I should be able to assign game objectives and have a ranking of the participants. I can think of doing it only if I can recover an idAvatar or something like that. How i can do? Thank you in advance Read More
Translated Viva Connections dashboard cards work as duplicates
We currently face the issue, that our translated dashboard cards in the translated dashboard.aspx work as duplicates. So when we make changes in a translated dashboard card, the changes also show up in the original language – which doesn’t make sense at all. To build the translated dashboard completely from scratch can’t be the solution, right?
We currently face the issue, that our translated dashboard cards in the translated dashboard.aspx work as duplicates. So when we make changes in a translated dashboard card, the changes also show up in the original language – which doesn’t make sense at all. To build the translated dashboard completely from scratch can’t be the solution, right? Read More
Return next value in list matching criteria
Hi
I have a list per the below and I want to use a formula to find a value according to the bank criteria.
For example for each bank “BNZ” I want to bring in the corresponding amounts.
When I use the formula =INDEX($A:$A,MATCH(“BNZ”,$D:$D,0)) and increment by 1, it works for the first 5 instances but then it just picks up the next item which is an ANZ entry rather than picking up the next BNZ entry further down the list
The listing is going to change each month depending on what transactions happen each month and there are obviously different numbers of transactions each month.
BankCurrencyPost DateAmountANZAUD1/07/2023-10258.50ANZAUD1/07/2023-19.80CBAAUD1/07/202316500.00CBAAUD1/07/2023365.44BNZNZD1/07/2023-0.60BNZNZD1/07/2023-13604.32BNZNZD1/07/2023-39.87BNZNZD1/07/2023-95720.00BNZNZD1/07/202315700.00ANZAUD2/07/2023-11400.00ANZAUD2/07/202316185.00ANZAUD2/07/20232200.00CBAAUD2/07/202333997.05BNZNZD2/07/202317450.00ANZAUD3/07/2023-33539.95ANZAUD3/07/2023869.71ANZAUD3/07/2023891.00ANZAUD3/07/20232200.00ANZAUD3/07/20236336.00ANZAUD3/07/2023477.77CBAAUD3/07/202335200.00BNZNZD3/07/2023495.90
Thanks in advance for your help
Rick
Hi I have a list per the below and I want to use a formula to find a value according to the bank criteria. For example for each bank “BNZ” I want to bring in the corresponding amounts. When I use the formula =INDEX($A:$A,MATCH(“BNZ”,$D:$D,0)) and increment by 1, it works for the first 5 instances but then it just picks up the next item which is an ANZ entry rather than picking up the next BNZ entry further down the list The listing is going to change each month depending on what transactions happen each month and there are obviously different numbers of transactions each month. BankCurrencyPost DateAmountANZAUD1/07/2023-10258.50ANZAUD1/07/2023-19.80CBAAUD1/07/202316500.00CBAAUD1/07/2023365.44BNZNZD1/07/2023-0.60BNZNZD1/07/2023-13604.32BNZNZD1/07/2023-39.87BNZNZD1/07/2023-95720.00BNZNZD1/07/202315700.00ANZAUD2/07/2023-11400.00ANZAUD2/07/202316185.00ANZAUD2/07/20232200.00CBAAUD2/07/202333997.05BNZNZD2/07/202317450.00ANZAUD3/07/2023-33539.95ANZAUD3/07/2023869.71ANZAUD3/07/2023891.00ANZAUD3/07/20232200.00ANZAUD3/07/20236336.00ANZAUD3/07/2023477.77CBAAUD3/07/202335200.00BNZNZD3/07/2023495.90 Thanks in advance for your helpRick Read More
Has Edge deprecated third party cookies?
Hi Team,
In a blog post in March, Microsoft mentioned it’s plan to deprecate third party cookies in Edge in 2024 starting with 1% rollout, however no timeline was provided for the full rollout. Based on our customer impact (can’t specify more details), It seems like edge has fully rolled out third party cookie deprecation. Can you please confirm the same? Is there some official communication related to this?
Hi Team,In a blog post in March, Microsoft mentioned it’s plan to deprecate third party cookies in Edge in 2024 starting with 1% rollout, however no timeline was provided for the full rollout. Based on our customer impact (can’t specify more details), It seems like edge has fully rolled out third party cookie deprecation. Can you please confirm the same? Is there some official communication related to this? Read More
Find utilized bandwidth of Azure IoT Hub
Hi All,
I am looking way to see usage of bandwidth of previous month on a per IoT Hub basis or better even on a per device basis.
How can this be done?
Thanks,
Ron
Hi All,I am looking way to see usage of bandwidth of previous month on a per IoT Hub basis or better even on a per device basis.How can this be done?Thanks,Ron Read More
Allowing User Input to Azure Data Factory flow
Good day All.
Please can you advise on the following scenario keeping in mind Synapse Pipelines / ADF is used for ETL.
I need to implement a solution where:
> Data is loaded into the Raw Layer
> Synapse: Executes ETL activities and load to Enriched Destination
> User (Business) : Needs to get an email to approve the data that has been transformed and in the enriched layer
> The ADF pipeline to await this approval before moving the data to the curated layer
> Once the Business user approves, the pipeline completes its execution into curated automatically.
Any Architectural Advise to archive this?
Thank you in advance.
Good day All.Please can you advise on the following scenario keeping in mind Synapse Pipelines / ADF is used for ETL.I need to implement a solution where:> Data is loaded into the Raw Layer> Synapse: Executes ETL activities and load to Enriched Destination> User (Business) : Needs to get an email to approve the data that has been transformed and in the enriched layer> The ADF pipeline to await this approval before moving the data to the curated layer> Once the Business user approves, the pipeline completes its execution into curated automatically.Any Architectural Advise to archive this?Thank you in advance. Read More
How to use C Caller block with C code having multiple functions ?
I want to use a C language code into simulink which has multiple functions in it. Can it be done by C Caller block.I want to use a C language code into simulink which has multiple functions in it. Can it be done by C Caller block. I want to use a C language code into simulink which has multiple functions in it. Can it be done by C Caller block. simulink, code generation MATLAB Answers — New Questions
Error in gui_mainfcn
function varargout = Ausgabe(varargin)
% AUSGABE MATLAB code for Ausgabe.fig
% AUSGABE, by itself, creates a new AUSGABE or raises the existing
% singleton*.
%
% H = AUSGABE returns the handle to a new AUSGABE or the handle to
% the existing singleton*.
%
% AUSGABE(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in AUSGABE.M with the given input arguments.
%
% AUSGABE(‘Property’,’Value’,…) creates a new AUSGABE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Ausgabe_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Ausgabe_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Ausgabe
% Last Modified by GUIDE v2.5 18-Jul-2019 11:15:33
% Begin initialization code – DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @Ausgabe_OpeningFcn, …
‘gui_OutputFcn’, @Ausgabe_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code – DO NOT EDIT
% — Executes just before Ausgabe is made visible.
function Ausgabe_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Ausgabe (see VARARGIN)
% Choose default command line output for Ausgabe
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Ausgabe wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = Ausgabe_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% — Executes on button press in Mark_pos.
function Mark_pos_Callback(hObject, eventdata, handles)
% hObject handle to Mark_pos (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global position pathname
uiwait(msgbox(‘please choose the Markerposition-Datei!’,’Achtung’,’modal’));
% [filename, pathname] = uigetfile( ‘*.mat’);
if isempty(pathname)==1
[filename, pathname] = uigetfile(‘*.mat’);
else
filename = uigetfile([pathname,’*.mat’]);
end
load(fullfile(pathname,filename));
p=position;
vid_lad_Callback(hObject, eventdata, handles);
% — Executes on button press in vid_lad.
function vid_lad_Callback(hObject, eventdata, handles)
% hObject handle to vid_lad (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global position sgf sgf2 h_w tetha_w alpha_w L knie_w knie_w2 d3_l sprung_w pedal_w kurbel_w fx fz F F_res beta_w beta_w2 fres kurbel_w0_index gew gew2 ho x0 y0 x1 y1 x2 y2
%% Winkelmessung
h=position.h;
knie=position.knie;
sprung=position.sprung;
fuss=position.fuss;
fx=position.kraftx(:,1);
fz=position.kraftz(:,1);
axes(handles.axes1);
%% Kniewinkelberechnungen
for i=1:length(h)
P0 = knie(i,:); %definieren Knie als Ursprungspunkt
P1 = h(i,:); %definieren H?ft als P1
P2 = sprung(i,:); %definieren Sprunggelenk als P1
n1 = (P2 – P0) / norm(P2 – P0); % Normalized vectors = Betr?g des Vektors
n2 = (P1 – P0) / norm(P1 – P0); % Normalized vectors = Betr?g des Vektors
knie_w(i) = acosd(dot(n1, n2)); % Kniewenkel
end
%%
%input Gewicht und L?nge des Unterschenkels
if isempty(gew)==1
gew={’95’};
gew2={‘5’};
L={‘0.4’};
else
gew={num2str(gew)};
gew2={num2str(gew2)};
L={num2str(L)};
end
gew=inputdlg({‘please enter body weight in kg’},’body weight’,1,gew);
gew=str2num(gew{1});
gew2=inputdlg({‘please enter weight plate in kg’},’weight’,1,gew2);
gew2=str2num(gew2{1});
L=inputdlg({‘please enter length of lower leg in m’},’length’,1,L);
L=str2num(L{1});
%% Variablen berechnen
%Patellarsehne-winkel berechnen
knie_w2 = knie_w’;
beta_w = -0.000012941919 .* (knie_w2 .^3) + 0.004613095238 .* (knie_w2 .^2) – 0.204942279942 .* knie_w2 – 14.142857142856;
beta_w2 = abs(beta_w);
%Winkel zwischen Tibia und y-Achse
alpha_w2 = knie_w2 – 90;
alpha_w = abs(alpha_w2);
%Winkel zwischen Femur und Patellarsehne-winkel
tetha_w = knie_w2 – beta_w;
%Hebel?rme
d1 = L * sind(alpha_w) * 0.43;
d2 = L * sind(alpha_w);
d3 = L / 5 * sind(beta_w2);
d3_l = (0.0000000002434 .* (knie_w2 .^6) – 0.0000001568469 .* (knie_w2 .^5) + 0.0000394291959 .* (knie_w2 .^4) – 0.0049457648343 .* (knie_w2 .^3) + 0.3289434274828 .* (knie_w2 .^2) – 11.0152767344929.* knie_w2 + 170.0411753969300) / 1000;
%Gewichte
gew_fuss = 5.3 / 100 * gew;
gew_last = gew2 + 6.853; %plus gewicht der Halterung 6.853 kg
%% Kr?fte Berechnen
%Bandkraft
F1 = (fx * (L – 0.05) + gew_fuss * 9.81 * d1 + gew_last * 9.81 * d2);
F = F1 ./ d3_l;
%Femoropatellarkraft
F_res = sqrt( 2 .* (F .^2) + 2 .* (F .^2) .* cosd (tetha_w));
% %% Berechnung der Mittelwerte
%
% %suchen die min. Winkel-Werte
% [AP, locs] = findpeaks(sgolayfilt(knie_w2,3,51),’MinPeakDistance’,120);
% %AP = -AP;
% l_AP = numel (AP); %Number of AP
%
% %die Messwerte der Kraft in jeden Vorgang verteilen
% for i=1:l_AP;
% if (i<l_AP)
% K{i} = F_res(locs(i):locs(i+1));
% else
% K{i} = F_res(locs(i):end);
% end
% end
% RR=padcat(K{1,:}); %die L?nge der Kraft-Werte ausgleichen
% KL=nanmean(RR’); %Mittelwert berechnen
% sgf = sgolayfilt(KL,3,51); %Filter
%
% %die Messwerte der Winkel in jeden Vorgang verteilen
% for i=1:l_AP;
% if (i<l_AP)
% WW{i} = knie_w2(locs(i):locs(i+1));
% else
% WW{i} = knie_w2(locs(i):end);
% end
% end
%
% LL=padcat(WW{1,:}); %die L?nge der Winkel-Werte ausgleichen
% WL=nanmean(LL’); %Mittelwert berechnen
% sgf2 = sgolayfilt(WL,4,51); %Filter
%%
set(handles.checkbox1,’val’,1);
set(handles.checkbox6,’val’,1);
% checkbox1_Callback(hObject, eventdata, handles);
% imshow(mov(1).cdata);
% — Executes on button press in checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject handle to checkbox1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2
cb1=get(handles.checkbox1,’val’);
cla;
close (figure(1));
if cb1==0
legend(‘off’);
else
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
axes(handles.axes1);
%% knie
hold on;
plot (sgolayfilt(knie_w2,3,51),’r’)
ylim([(min(knie_w2)-5) (max(knie_w2)+5)])
%%
xlabel(‘frame’);
ylabel(‘angle of knee extension in degree’);
legend(‘Winkel der Streckung’)
end
% Untitled2;
% — Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
global F_res knie_w2 P2 sgf sgf2
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb2==0
delete(P2);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
axes(handles.axes1);
%% Bandkraft
hold off;
P2 = plot (knie_w2,sgolayfilt(F_res,3,51),sgf2,sgf);
%%
xlabel(‘angle of knie extension in degree’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’,’Summation’)
% x_fir_h=plot(h4,’b’);
end
% for i=2:length(kurbel_w0_index)-1
%
% plot(kurbel_w0_index(i)-33,fres.h1(kurbel_w0_index(i)-2),’*’);
% endhandles
% Hint: get(hObject,’Value’) returns toggle state of checkbox2
legend_f(handles);
% — Executes on button press in checkbox3.
function checkbox3_Callback(hObject, eventdata, handles)
% hObject handle to checkbox3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global F_res knie_w2 P3 sgf sgf2
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb3==0
delete(P3);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
%% Kniekraft
hold off;
P3 = plot (sgf2,sgf);
ylim([(min(sgf)-200) (max(sgf)+200)])
index = find(sgf==max(sgf));
txt = [‘max = ‘, num2str(max(sgf)),’ N’,’ ; ‘ num2str(sgf2(index)),’ Grad’];
text(sgf2(index)-15,max(sgf)+10,txt)
%%
xlabel(‘angle of knie extension in degree’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox3
% — Executes on button press in checkbox4.
function checkbox4_Callback(hObject, eventdata, handles)
% hObject handle to checkbox4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2 d3_l P4 sgf sgf2 L t
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb4==0
delete(P4);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
%% Berechnung der Winkel?nderung
%[min_sgf2,min_locs] = findpeaks((-1 * sgf2),’MinPeakDistance’,100);
%min_sgf2 = -1 * min_sgf2;
%findpeaks((-1 * sgf2),’MinPeakDistance’,100);
%
%for i = 1:length(sgf2)
% d_sgf2(i) = sgf2(i) – min_sgf2;
%end
%% Berechnung der Zeit
for i = 1:length(sgf)
t(i) = i*17/801;
end
% %% Berechnung der Leistung
% for i = min_locs:length(sgf)
% if d_sgf2(i) > 0
% P(i) = ((sgf(i) – sgf(min_locs)) * 2 * pi * L * d_sgf2 (i) / 360) / (t(i)-t(min_locs));
% else
% P(i) = NaN;
% end
% end
%% Streckungwinkel gegen Zeit
hold off;
P4 = plot (t,sgf2,’r’);
ylim([(min(sgf2)-5) (max(sgf2)+5)])
xlabel(‘time [s]’);
ylabel(‘angle of knie extension in degree’);
legend(‘Winkel der Streckung’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox4
% — Executes on button press in checkbox5.
function checkbox5_Callback(hObject, eventdata, handles)
% hObject handle to checkbox5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fx fz f_x f_r kurbel_w0_index kurbel_w
cb1=get(handles.checkbox1,’val’);
cb5=get(handles.checkbox5,’val’);
cla;
if cb1==1
close (figure(1)) ;
end
if cb5==0
cla;
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
% f_x=plot(fx, ‘m’);
% hold on
% f_z=plot(fz, ‘cyan’);
% f_r=plot(fr, ‘b’);
% hold on
% f_r=plot(fres.h1,’r’)
f_x=1:length(fx);
B = fir1(60,0.4);
% plot(h4,’r’)
% x_fir = filtfilt (B, 1, fr);
% hold on;
f_r=plot(f_x,fx,’b’,f_x,fz,’r’);
xlabel(‘Frame’);
ylabel(‘force in sensor [N]’);
legend(‘x-component’,’z-component’);
%
% cla;
% [a,b]= size(kurbel_w0_index);
% h2=zeros(length(kurbel_w0_index),359);
% h25=zeros(length(kurbel_w0_index),359);
% h26=zeros(length(kurbel_w0_index),359);
% for i=1:b-1
% j=kurbel_w0_index(i);
% % hold on
% % plot(kurbel_w(j:kurbel_w0_index(i+1)-1),fres.h1(j:kurbel_w0_index(i+1)-1))
%
% h3=fr(j:kurbel_w0_index(i+1)-1);
% h5=fx(j:kurbel_w0_index(i+1)-1);
% h6=fz(j:kurbel_w0_index(i+1)-1);
% fh(i).c=h3;
% fh5(i).c=h5;
% fh6(i).c=h6;
% h1=kurbel_w(j:kurbel_w0_index(i+1)-1);
% fh3(i).c=h1;
% % length(h1)
%
% for k=1:length(h3)
% kk=round(kurbel_w(j+k-1))-1;
% if kk<=0
% kk=1;
% end
% h2(i,kk)=(h3(k)+h2(kk));
% h25(i,kk)=(h5(k)+h25(kk));
% h26(i,kk)=(h6(k)+h26(kk));
%
% end
%
% end
%
% j=1;
% for i=1:length(h2)
% if i<21
% s1=h2(:,length(h2)-20+i:length(h2));
% s5=h25(:,length(h25)-20+i:length(h25));
% s6=h26(:,length(h26)-20+i:length(h26));
% s2=h2(:,1:i);
% s25=h25(:,1:i);
% s26=h26(:,1:i);
%
% s=[s1,s2];
% s55=[s5,s25];
% s66=[s6,s26];
% else
% s=h2(:,i-20:i);
% s55=h25(:,i-20:i);
% s66=h26(:,i-20:i);
% end
% s=s(s~=0);
% h4(i)=sum(s)/length(s);
% s55=s55(s55~=0);
% h45(i)=sum(s55)/length(s55);
% s66=s66(s66~=0);
% h46(i)=sum(s66)/length(s66);
%
% end
%
% h4(isnan(h4))=[];
% plot(h4)
% hold on
% h45(isnan(h45))=[];
% plot(h45,’r’)
% h6(isnan(h46))=[];
% plot(h46,’g’)
% % Hint: get(hObject,’Value’) returns toggle state of checkbox5
% legend(‘resultierende Pedal Kraft’,’z-Komponente’,’x-Komponente’);
end
% — Executes on button press in loeschen.
function loeschen_Callback(hObject, eventdata, handles)
% hObject handle to loeschen (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear all;
% — Executes on button press in checkbox6.
function checkbox6_Callback(hObject, eventdata, handles)
% hObject handle to checkbox6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2 F_res P6 sgf sgf2 t d3_l
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb6==0
delete(P6);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
%% Berechnung der Zeit
for i = 1:length(sgf2)
t(i) = i*17/801;
end
%% res. Kniekraft gegen Zeit
hold off;
P6 = plot (t,sgf,’r’);
ylim([(min(sgf)-200) (max(sgf)+200)])
index = find(sgf==max(sgf));
txt = [‘max = ‘, num2str(max(sgf)),’ N’,’ ; ‘ num2str(t(index)),’ s’];
text(t(index)-0.20,max(sgf)+40,txt)
%%
xlabel(‘time [s]’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox4
% Hint: get(hObject,’Value’) returns toggle state of checkbox6
function legend_f(handles)
global x_fir_h x_fir_k x_fir_s
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb6=get(handles.checkbox6,’val’);
if cb6==1
i=1;
if cb2==1 && length(x_fir_h)==1
L{i}=’H?ftkraft’;
x_fir(i)=x_fir_h;
i=i+1;
end
if cb3==1 && length(x_fir_k)==1
L{i}=’Kniekraft’;
x_fir(i)=x_fir_k;
i=i+1;
end
if cb4==1 && length(x_fir_s)==1
L{i}=’Sprunggelenkkraft’;
x_fir(i)=x_fir_s;
i=i+1;
end
% Hint: get(hObject,’Value’) returns toggle state of checkbox6
if i>1
legend(x_fir,L);
end
end
% — Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sgf sgf2 peaks_l peaks_v knie_w2 F_res cb1
%% Summation bestimmen
%Ausw?hlen min. bzw. max. Peaks durch -1 bzw. 1 Eingabe
% close (figure(2));
if isempty(peaks_l)==1
peaks_l={‘150’};
peaks_v={‘1’};
else
peaks_l={num2str(peaks_l)};
peaks_v={num2str(peaks_v)};
end
peaks_l=inputdlg({‘please enter peaks distance’},’peaksdistance’,1,peaks_l);
peaks_l=str2num(peaks_l{1});
peaks_v=inputdlg({‘max. peaks = 1 or min. peaks = -1′},’peaksvalue’,1,peaks_v);
peaks_v=str2num(peaks_v{1});
%Suchen die min. bzw max. Winkel-Werte
[AP, locs] = findpeaks(sgolayfilt(peaks_v * knie_w2,3,51),’MinPeakDistance’,peaks_l);
AP = peaks_v * AP;
l_AP = numel (AP); %Number of AP
%plotting findpeaks
% cla;
figure(2);
findpeaks(sgolayfilt(peaks_v * knie_w2,3,51),’MinPeakDistance’,peaks_l);
xlabel(‘frame’);
ylabel(‘angle of knee extension in degree’);
legend(‘Winkel der Streckung’)
%die Messwerte der Kraft in jeden Vorgang verteilen
for i=1:l_AP;
if (i<l_AP)
K{i} = F_res(locs(i):locs(i+1));
else
K{i} = F_res(locs(i):end);
end
end
RR=padcat(K{1,:}); %die L?nge der Kraft-Werte ausgleichen
KL=nanmean(RR’); %Mittelwert berechnen
sgf = sgolayfilt(KL,3,51); %Filter
%die Messwerte der Winkel in jeden Vorgang verteilen
for i=1:l_AP;
if (i<l_AP)
WW{i} = knie_w2(locs(i):locs(i+1));
else
WW{i} = knie_w2(locs(i):end);
end
end
LL=padcat(WW{1,:}); %die L?nge der Winkel-Werte ausgleichen
WL=nanmean(LL’); %Mittelwert berechnen
sgf2 = sgolayfilt(WL,4,51); %Filter
% — Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sgf sgf2 t knie_w2 F_res
frame = (1:length(F_res))’;
kniekraft = F_res;
kniewinkel = knie_w2;
sum_zeit = t’;
sum_kniewinkel = sgf2′;
sum_kniekraft = sgf’;
% Get the name of the file that the user wants to save.
% Note, if you’re saving an image you can use imsave() instead of uiputfile().
startingFolder = userpath; % Or "pwd" or wherever you want.
defaultFileName = fullfile(startingFolder, ‘.xlsx’);
[baseFileName, folder] = uiputfile(defaultFileName, ‘Specify a file’);
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName);
Tab1 = table(frame,kniekraft,kniewinkel);
Tab2 = table (sum_zeit,sum_kniekraft,sum_kniewinkel);
%xlswrite(fullFileName, Tab1, ‘A1’)
%xlswrite(fullFileName, Tab2, ‘D1’)
writetable(Tab1,fullFileName);
writetable(Tab2,fullFileName,’Sheet’,1,’Range’,’D1′);
Unrecognized function or variable ‘nanmean’.
Error in Ausgabe>pushbutton4_Callback (line 675)
KL=nanmean(RR’); %Mittelwert berechnen
Error in gui_mainfcn (line 90)
feval(varargin{:});
Error in Ausgabe (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)Ausgabe(‘pushbutton4_Callback’,hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.function varargout = Ausgabe(varargin)
% AUSGABE MATLAB code for Ausgabe.fig
% AUSGABE, by itself, creates a new AUSGABE or raises the existing
% singleton*.
%
% H = AUSGABE returns the handle to a new AUSGABE or the handle to
% the existing singleton*.
%
% AUSGABE(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in AUSGABE.M with the given input arguments.
%
% AUSGABE(‘Property’,’Value’,…) creates a new AUSGABE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Ausgabe_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Ausgabe_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Ausgabe
% Last Modified by GUIDE v2.5 18-Jul-2019 11:15:33
% Begin initialization code – DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @Ausgabe_OpeningFcn, …
‘gui_OutputFcn’, @Ausgabe_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code – DO NOT EDIT
% — Executes just before Ausgabe is made visible.
function Ausgabe_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Ausgabe (see VARARGIN)
% Choose default command line output for Ausgabe
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Ausgabe wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = Ausgabe_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% — Executes on button press in Mark_pos.
function Mark_pos_Callback(hObject, eventdata, handles)
% hObject handle to Mark_pos (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global position pathname
uiwait(msgbox(‘please choose the Markerposition-Datei!’,’Achtung’,’modal’));
% [filename, pathname] = uigetfile( ‘*.mat’);
if isempty(pathname)==1
[filename, pathname] = uigetfile(‘*.mat’);
else
filename = uigetfile([pathname,’*.mat’]);
end
load(fullfile(pathname,filename));
p=position;
vid_lad_Callback(hObject, eventdata, handles);
% — Executes on button press in vid_lad.
function vid_lad_Callback(hObject, eventdata, handles)
% hObject handle to vid_lad (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global position sgf sgf2 h_w tetha_w alpha_w L knie_w knie_w2 d3_l sprung_w pedal_w kurbel_w fx fz F F_res beta_w beta_w2 fres kurbel_w0_index gew gew2 ho x0 y0 x1 y1 x2 y2
%% Winkelmessung
h=position.h;
knie=position.knie;
sprung=position.sprung;
fuss=position.fuss;
fx=position.kraftx(:,1);
fz=position.kraftz(:,1);
axes(handles.axes1);
%% Kniewinkelberechnungen
for i=1:length(h)
P0 = knie(i,:); %definieren Knie als Ursprungspunkt
P1 = h(i,:); %definieren H?ft als P1
P2 = sprung(i,:); %definieren Sprunggelenk als P1
n1 = (P2 – P0) / norm(P2 – P0); % Normalized vectors = Betr?g des Vektors
n2 = (P1 – P0) / norm(P1 – P0); % Normalized vectors = Betr?g des Vektors
knie_w(i) = acosd(dot(n1, n2)); % Kniewenkel
end
%%
%input Gewicht und L?nge des Unterschenkels
if isempty(gew)==1
gew={’95’};
gew2={‘5’};
L={‘0.4’};
else
gew={num2str(gew)};
gew2={num2str(gew2)};
L={num2str(L)};
end
gew=inputdlg({‘please enter body weight in kg’},’body weight’,1,gew);
gew=str2num(gew{1});
gew2=inputdlg({‘please enter weight plate in kg’},’weight’,1,gew2);
gew2=str2num(gew2{1});
L=inputdlg({‘please enter length of lower leg in m’},’length’,1,L);
L=str2num(L{1});
%% Variablen berechnen
%Patellarsehne-winkel berechnen
knie_w2 = knie_w’;
beta_w = -0.000012941919 .* (knie_w2 .^3) + 0.004613095238 .* (knie_w2 .^2) – 0.204942279942 .* knie_w2 – 14.142857142856;
beta_w2 = abs(beta_w);
%Winkel zwischen Tibia und y-Achse
alpha_w2 = knie_w2 – 90;
alpha_w = abs(alpha_w2);
%Winkel zwischen Femur und Patellarsehne-winkel
tetha_w = knie_w2 – beta_w;
%Hebel?rme
d1 = L * sind(alpha_w) * 0.43;
d2 = L * sind(alpha_w);
d3 = L / 5 * sind(beta_w2);
d3_l = (0.0000000002434 .* (knie_w2 .^6) – 0.0000001568469 .* (knie_w2 .^5) + 0.0000394291959 .* (knie_w2 .^4) – 0.0049457648343 .* (knie_w2 .^3) + 0.3289434274828 .* (knie_w2 .^2) – 11.0152767344929.* knie_w2 + 170.0411753969300) / 1000;
%Gewichte
gew_fuss = 5.3 / 100 * gew;
gew_last = gew2 + 6.853; %plus gewicht der Halterung 6.853 kg
%% Kr?fte Berechnen
%Bandkraft
F1 = (fx * (L – 0.05) + gew_fuss * 9.81 * d1 + gew_last * 9.81 * d2);
F = F1 ./ d3_l;
%Femoropatellarkraft
F_res = sqrt( 2 .* (F .^2) + 2 .* (F .^2) .* cosd (tetha_w));
% %% Berechnung der Mittelwerte
%
% %suchen die min. Winkel-Werte
% [AP, locs] = findpeaks(sgolayfilt(knie_w2,3,51),’MinPeakDistance’,120);
% %AP = -AP;
% l_AP = numel (AP); %Number of AP
%
% %die Messwerte der Kraft in jeden Vorgang verteilen
% for i=1:l_AP;
% if (i<l_AP)
% K{i} = F_res(locs(i):locs(i+1));
% else
% K{i} = F_res(locs(i):end);
% end
% end
% RR=padcat(K{1,:}); %die L?nge der Kraft-Werte ausgleichen
% KL=nanmean(RR’); %Mittelwert berechnen
% sgf = sgolayfilt(KL,3,51); %Filter
%
% %die Messwerte der Winkel in jeden Vorgang verteilen
% for i=1:l_AP;
% if (i<l_AP)
% WW{i} = knie_w2(locs(i):locs(i+1));
% else
% WW{i} = knie_w2(locs(i):end);
% end
% end
%
% LL=padcat(WW{1,:}); %die L?nge der Winkel-Werte ausgleichen
% WL=nanmean(LL’); %Mittelwert berechnen
% sgf2 = sgolayfilt(WL,4,51); %Filter
%%
set(handles.checkbox1,’val’,1);
set(handles.checkbox6,’val’,1);
% checkbox1_Callback(hObject, eventdata, handles);
% imshow(mov(1).cdata);
% — Executes on button press in checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject handle to checkbox1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2
cb1=get(handles.checkbox1,’val’);
cla;
close (figure(1));
if cb1==0
legend(‘off’);
else
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
axes(handles.axes1);
%% knie
hold on;
plot (sgolayfilt(knie_w2,3,51),’r’)
ylim([(min(knie_w2)-5) (max(knie_w2)+5)])
%%
xlabel(‘frame’);
ylabel(‘angle of knee extension in degree’);
legend(‘Winkel der Streckung’)
end
% Untitled2;
% — Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
global F_res knie_w2 P2 sgf sgf2
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb2==0
delete(P2);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
axes(handles.axes1);
%% Bandkraft
hold off;
P2 = plot (knie_w2,sgolayfilt(F_res,3,51),sgf2,sgf);
%%
xlabel(‘angle of knie extension in degree’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’,’Summation’)
% x_fir_h=plot(h4,’b’);
end
% for i=2:length(kurbel_w0_index)-1
%
% plot(kurbel_w0_index(i)-33,fres.h1(kurbel_w0_index(i)-2),’*’);
% endhandles
% Hint: get(hObject,’Value’) returns toggle state of checkbox2
legend_f(handles);
% — Executes on button press in checkbox3.
function checkbox3_Callback(hObject, eventdata, handles)
% hObject handle to checkbox3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global F_res knie_w2 P3 sgf sgf2
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb3==0
delete(P3);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
%% Kniekraft
hold off;
P3 = plot (sgf2,sgf);
ylim([(min(sgf)-200) (max(sgf)+200)])
index = find(sgf==max(sgf));
txt = [‘max = ‘, num2str(max(sgf)),’ N’,’ ; ‘ num2str(sgf2(index)),’ Grad’];
text(sgf2(index)-15,max(sgf)+10,txt)
%%
xlabel(‘angle of knie extension in degree’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox3
% — Executes on button press in checkbox4.
function checkbox4_Callback(hObject, eventdata, handles)
% hObject handle to checkbox4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2 d3_l P4 sgf sgf2 L t
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb4==0
delete(P4);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
%% Berechnung der Winkel?nderung
%[min_sgf2,min_locs] = findpeaks((-1 * sgf2),’MinPeakDistance’,100);
%min_sgf2 = -1 * min_sgf2;
%findpeaks((-1 * sgf2),’MinPeakDistance’,100);
%
%for i = 1:length(sgf2)
% d_sgf2(i) = sgf2(i) – min_sgf2;
%end
%% Berechnung der Zeit
for i = 1:length(sgf)
t(i) = i*17/801;
end
% %% Berechnung der Leistung
% for i = min_locs:length(sgf)
% if d_sgf2(i) > 0
% P(i) = ((sgf(i) – sgf(min_locs)) * 2 * pi * L * d_sgf2 (i) / 360) / (t(i)-t(min_locs));
% else
% P(i) = NaN;
% end
% end
%% Streckungwinkel gegen Zeit
hold off;
P4 = plot (t,sgf2,’r’);
ylim([(min(sgf2)-5) (max(sgf2)+5)])
xlabel(‘time [s]’);
ylabel(‘angle of knie extension in degree’);
legend(‘Winkel der Streckung’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox4
% — Executes on button press in checkbox5.
function checkbox5_Callback(hObject, eventdata, handles)
% hObject handle to checkbox5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fx fz f_x f_r kurbel_w0_index kurbel_w
cb1=get(handles.checkbox1,’val’);
cb5=get(handles.checkbox5,’val’);
cla;
if cb1==1
close (figure(1)) ;
end
if cb5==0
cla;
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
% f_x=plot(fx, ‘m’);
% hold on
% f_z=plot(fz, ‘cyan’);
% f_r=plot(fr, ‘b’);
% hold on
% f_r=plot(fres.h1,’r’)
f_x=1:length(fx);
B = fir1(60,0.4);
% plot(h4,’r’)
% x_fir = filtfilt (B, 1, fr);
% hold on;
f_r=plot(f_x,fx,’b’,f_x,fz,’r’);
xlabel(‘Frame’);
ylabel(‘force in sensor [N]’);
legend(‘x-component’,’z-component’);
%
% cla;
% [a,b]= size(kurbel_w0_index);
% h2=zeros(length(kurbel_w0_index),359);
% h25=zeros(length(kurbel_w0_index),359);
% h26=zeros(length(kurbel_w0_index),359);
% for i=1:b-1
% j=kurbel_w0_index(i);
% % hold on
% % plot(kurbel_w(j:kurbel_w0_index(i+1)-1),fres.h1(j:kurbel_w0_index(i+1)-1))
%
% h3=fr(j:kurbel_w0_index(i+1)-1);
% h5=fx(j:kurbel_w0_index(i+1)-1);
% h6=fz(j:kurbel_w0_index(i+1)-1);
% fh(i).c=h3;
% fh5(i).c=h5;
% fh6(i).c=h6;
% h1=kurbel_w(j:kurbel_w0_index(i+1)-1);
% fh3(i).c=h1;
% % length(h1)
%
% for k=1:length(h3)
% kk=round(kurbel_w(j+k-1))-1;
% if kk<=0
% kk=1;
% end
% h2(i,kk)=(h3(k)+h2(kk));
% h25(i,kk)=(h5(k)+h25(kk));
% h26(i,kk)=(h6(k)+h26(kk));
%
% end
%
% end
%
% j=1;
% for i=1:length(h2)
% if i<21
% s1=h2(:,length(h2)-20+i:length(h2));
% s5=h25(:,length(h25)-20+i:length(h25));
% s6=h26(:,length(h26)-20+i:length(h26));
% s2=h2(:,1:i);
% s25=h25(:,1:i);
% s26=h26(:,1:i);
%
% s=[s1,s2];
% s55=[s5,s25];
% s66=[s6,s26];
% else
% s=h2(:,i-20:i);
% s55=h25(:,i-20:i);
% s66=h26(:,i-20:i);
% end
% s=s(s~=0);
% h4(i)=sum(s)/length(s);
% s55=s55(s55~=0);
% h45(i)=sum(s55)/length(s55);
% s66=s66(s66~=0);
% h46(i)=sum(s66)/length(s66);
%
% end
%
% h4(isnan(h4))=[];
% plot(h4)
% hold on
% h45(isnan(h45))=[];
% plot(h45,’r’)
% h6(isnan(h46))=[];
% plot(h46,’g’)
% % Hint: get(hObject,’Value’) returns toggle state of checkbox5
% legend(‘resultierende Pedal Kraft’,’z-Komponente’,’x-Komponente’);
end
% — Executes on button press in loeschen.
function loeschen_Callback(hObject, eventdata, handles)
% hObject handle to loeschen (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear all;
% — Executes on button press in checkbox6.
function checkbox6_Callback(hObject, eventdata, handles)
% hObject handle to checkbox6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2 F_res P6 sgf sgf2 t d3_l
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb6==0
delete(P6);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
%% Berechnung der Zeit
for i = 1:length(sgf2)
t(i) = i*17/801;
end
%% res. Kniekraft gegen Zeit
hold off;
P6 = plot (t,sgf,’r’);
ylim([(min(sgf)-200) (max(sgf)+200)])
index = find(sgf==max(sgf));
txt = [‘max = ‘, num2str(max(sgf)),’ N’,’ ; ‘ num2str(t(index)),’ s’];
text(t(index)-0.20,max(sgf)+40,txt)
%%
xlabel(‘time [s]’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox4
% Hint: get(hObject,’Value’) returns toggle state of checkbox6
function legend_f(handles)
global x_fir_h x_fir_k x_fir_s
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb6=get(handles.checkbox6,’val’);
if cb6==1
i=1;
if cb2==1 && length(x_fir_h)==1
L{i}=’H?ftkraft’;
x_fir(i)=x_fir_h;
i=i+1;
end
if cb3==1 && length(x_fir_k)==1
L{i}=’Kniekraft’;
x_fir(i)=x_fir_k;
i=i+1;
end
if cb4==1 && length(x_fir_s)==1
L{i}=’Sprunggelenkkraft’;
x_fir(i)=x_fir_s;
i=i+1;
end
% Hint: get(hObject,’Value’) returns toggle state of checkbox6
if i>1
legend(x_fir,L);
end
end
% — Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sgf sgf2 peaks_l peaks_v knie_w2 F_res cb1
%% Summation bestimmen
%Ausw?hlen min. bzw. max. Peaks durch -1 bzw. 1 Eingabe
% close (figure(2));
if isempty(peaks_l)==1
peaks_l={‘150’};
peaks_v={‘1’};
else
peaks_l={num2str(peaks_l)};
peaks_v={num2str(peaks_v)};
end
peaks_l=inputdlg({‘please enter peaks distance’},’peaksdistance’,1,peaks_l);
peaks_l=str2num(peaks_l{1});
peaks_v=inputdlg({‘max. peaks = 1 or min. peaks = -1′},’peaksvalue’,1,peaks_v);
peaks_v=str2num(peaks_v{1});
%Suchen die min. bzw max. Winkel-Werte
[AP, locs] = findpeaks(sgolayfilt(peaks_v * knie_w2,3,51),’MinPeakDistance’,peaks_l);
AP = peaks_v * AP;
l_AP = numel (AP); %Number of AP
%plotting findpeaks
% cla;
figure(2);
findpeaks(sgolayfilt(peaks_v * knie_w2,3,51),’MinPeakDistance’,peaks_l);
xlabel(‘frame’);
ylabel(‘angle of knee extension in degree’);
legend(‘Winkel der Streckung’)
%die Messwerte der Kraft in jeden Vorgang verteilen
for i=1:l_AP;
if (i<l_AP)
K{i} = F_res(locs(i):locs(i+1));
else
K{i} = F_res(locs(i):end);
end
end
RR=padcat(K{1,:}); %die L?nge der Kraft-Werte ausgleichen
KL=nanmean(RR’); %Mittelwert berechnen
sgf = sgolayfilt(KL,3,51); %Filter
%die Messwerte der Winkel in jeden Vorgang verteilen
for i=1:l_AP;
if (i<l_AP)
WW{i} = knie_w2(locs(i):locs(i+1));
else
WW{i} = knie_w2(locs(i):end);
end
end
LL=padcat(WW{1,:}); %die L?nge der Winkel-Werte ausgleichen
WL=nanmean(LL’); %Mittelwert berechnen
sgf2 = sgolayfilt(WL,4,51); %Filter
% — Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sgf sgf2 t knie_w2 F_res
frame = (1:length(F_res))’;
kniekraft = F_res;
kniewinkel = knie_w2;
sum_zeit = t’;
sum_kniewinkel = sgf2′;
sum_kniekraft = sgf’;
% Get the name of the file that the user wants to save.
% Note, if you’re saving an image you can use imsave() instead of uiputfile().
startingFolder = userpath; % Or "pwd" or wherever you want.
defaultFileName = fullfile(startingFolder, ‘.xlsx’);
[baseFileName, folder] = uiputfile(defaultFileName, ‘Specify a file’);
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName);
Tab1 = table(frame,kniekraft,kniewinkel);
Tab2 = table (sum_zeit,sum_kniekraft,sum_kniewinkel);
%xlswrite(fullFileName, Tab1, ‘A1’)
%xlswrite(fullFileName, Tab2, ‘D1’)
writetable(Tab1,fullFileName);
writetable(Tab2,fullFileName,’Sheet’,1,’Range’,’D1′);
Unrecognized function or variable ‘nanmean’.
Error in Ausgabe>pushbutton4_Callback (line 675)
KL=nanmean(RR’); %Mittelwert berechnen
Error in gui_mainfcn (line 90)
feval(varargin{:});
Error in Ausgabe (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)Ausgabe(‘pushbutton4_Callback’,hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback. function varargout = Ausgabe(varargin)
% AUSGABE MATLAB code for Ausgabe.fig
% AUSGABE, by itself, creates a new AUSGABE or raises the existing
% singleton*.
%
% H = AUSGABE returns the handle to a new AUSGABE or the handle to
% the existing singleton*.
%
% AUSGABE(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in AUSGABE.M with the given input arguments.
%
% AUSGABE(‘Property’,’Value’,…) creates a new AUSGABE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Ausgabe_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Ausgabe_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Ausgabe
% Last Modified by GUIDE v2.5 18-Jul-2019 11:15:33
% Begin initialization code – DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @Ausgabe_OpeningFcn, …
‘gui_OutputFcn’, @Ausgabe_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code – DO NOT EDIT
% — Executes just before Ausgabe is made visible.
function Ausgabe_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Ausgabe (see VARARGIN)
% Choose default command line output for Ausgabe
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Ausgabe wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = Ausgabe_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% — Executes on button press in Mark_pos.
function Mark_pos_Callback(hObject, eventdata, handles)
% hObject handle to Mark_pos (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global position pathname
uiwait(msgbox(‘please choose the Markerposition-Datei!’,’Achtung’,’modal’));
% [filename, pathname] = uigetfile( ‘*.mat’);
if isempty(pathname)==1
[filename, pathname] = uigetfile(‘*.mat’);
else
filename = uigetfile([pathname,’*.mat’]);
end
load(fullfile(pathname,filename));
p=position;
vid_lad_Callback(hObject, eventdata, handles);
% — Executes on button press in vid_lad.
function vid_lad_Callback(hObject, eventdata, handles)
% hObject handle to vid_lad (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global position sgf sgf2 h_w tetha_w alpha_w L knie_w knie_w2 d3_l sprung_w pedal_w kurbel_w fx fz F F_res beta_w beta_w2 fres kurbel_w0_index gew gew2 ho x0 y0 x1 y1 x2 y2
%% Winkelmessung
h=position.h;
knie=position.knie;
sprung=position.sprung;
fuss=position.fuss;
fx=position.kraftx(:,1);
fz=position.kraftz(:,1);
axes(handles.axes1);
%% Kniewinkelberechnungen
for i=1:length(h)
P0 = knie(i,:); %definieren Knie als Ursprungspunkt
P1 = h(i,:); %definieren H?ft als P1
P2 = sprung(i,:); %definieren Sprunggelenk als P1
n1 = (P2 – P0) / norm(P2 – P0); % Normalized vectors = Betr?g des Vektors
n2 = (P1 – P0) / norm(P1 – P0); % Normalized vectors = Betr?g des Vektors
knie_w(i) = acosd(dot(n1, n2)); % Kniewenkel
end
%%
%input Gewicht und L?nge des Unterschenkels
if isempty(gew)==1
gew={’95’};
gew2={‘5’};
L={‘0.4’};
else
gew={num2str(gew)};
gew2={num2str(gew2)};
L={num2str(L)};
end
gew=inputdlg({‘please enter body weight in kg’},’body weight’,1,gew);
gew=str2num(gew{1});
gew2=inputdlg({‘please enter weight plate in kg’},’weight’,1,gew2);
gew2=str2num(gew2{1});
L=inputdlg({‘please enter length of lower leg in m’},’length’,1,L);
L=str2num(L{1});
%% Variablen berechnen
%Patellarsehne-winkel berechnen
knie_w2 = knie_w’;
beta_w = -0.000012941919 .* (knie_w2 .^3) + 0.004613095238 .* (knie_w2 .^2) – 0.204942279942 .* knie_w2 – 14.142857142856;
beta_w2 = abs(beta_w);
%Winkel zwischen Tibia und y-Achse
alpha_w2 = knie_w2 – 90;
alpha_w = abs(alpha_w2);
%Winkel zwischen Femur und Patellarsehne-winkel
tetha_w = knie_w2 – beta_w;
%Hebel?rme
d1 = L * sind(alpha_w) * 0.43;
d2 = L * sind(alpha_w);
d3 = L / 5 * sind(beta_w2);
d3_l = (0.0000000002434 .* (knie_w2 .^6) – 0.0000001568469 .* (knie_w2 .^5) + 0.0000394291959 .* (knie_w2 .^4) – 0.0049457648343 .* (knie_w2 .^3) + 0.3289434274828 .* (knie_w2 .^2) – 11.0152767344929.* knie_w2 + 170.0411753969300) / 1000;
%Gewichte
gew_fuss = 5.3 / 100 * gew;
gew_last = gew2 + 6.853; %plus gewicht der Halterung 6.853 kg
%% Kr?fte Berechnen
%Bandkraft
F1 = (fx * (L – 0.05) + gew_fuss * 9.81 * d1 + gew_last * 9.81 * d2);
F = F1 ./ d3_l;
%Femoropatellarkraft
F_res = sqrt( 2 .* (F .^2) + 2 .* (F .^2) .* cosd (tetha_w));
% %% Berechnung der Mittelwerte
%
% %suchen die min. Winkel-Werte
% [AP, locs] = findpeaks(sgolayfilt(knie_w2,3,51),’MinPeakDistance’,120);
% %AP = -AP;
% l_AP = numel (AP); %Number of AP
%
% %die Messwerte der Kraft in jeden Vorgang verteilen
% for i=1:l_AP;
% if (i<l_AP)
% K{i} = F_res(locs(i):locs(i+1));
% else
% K{i} = F_res(locs(i):end);
% end
% end
% RR=padcat(K{1,:}); %die L?nge der Kraft-Werte ausgleichen
% KL=nanmean(RR’); %Mittelwert berechnen
% sgf = sgolayfilt(KL,3,51); %Filter
%
% %die Messwerte der Winkel in jeden Vorgang verteilen
% for i=1:l_AP;
% if (i<l_AP)
% WW{i} = knie_w2(locs(i):locs(i+1));
% else
% WW{i} = knie_w2(locs(i):end);
% end
% end
%
% LL=padcat(WW{1,:}); %die L?nge der Winkel-Werte ausgleichen
% WL=nanmean(LL’); %Mittelwert berechnen
% sgf2 = sgolayfilt(WL,4,51); %Filter
%%
set(handles.checkbox1,’val’,1);
set(handles.checkbox6,’val’,1);
% checkbox1_Callback(hObject, eventdata, handles);
% imshow(mov(1).cdata);
% — Executes on button press in checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject handle to checkbox1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2
cb1=get(handles.checkbox1,’val’);
cla;
close (figure(1));
if cb1==0
legend(‘off’);
else
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
axes(handles.axes1);
%% knie
hold on;
plot (sgolayfilt(knie_w2,3,51),’r’)
ylim([(min(knie_w2)-5) (max(knie_w2)+5)])
%%
xlabel(‘frame’);
ylabel(‘angle of knee extension in degree’);
legend(‘Winkel der Streckung’)
end
% Untitled2;
% — Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
global F_res knie_w2 P2 sgf sgf2
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb2==0
delete(P2);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
axes(handles.axes1);
%% Bandkraft
hold off;
P2 = plot (knie_w2,sgolayfilt(F_res,3,51),sgf2,sgf);
%%
xlabel(‘angle of knie extension in degree’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’,’Summation’)
% x_fir_h=plot(h4,’b’);
end
% for i=2:length(kurbel_w0_index)-1
%
% plot(kurbel_w0_index(i)-33,fres.h1(kurbel_w0_index(i)-2),’*’);
% endhandles
% Hint: get(hObject,’Value’) returns toggle state of checkbox2
legend_f(handles);
% — Executes on button press in checkbox3.
function checkbox3_Callback(hObject, eventdata, handles)
% hObject handle to checkbox3 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global F_res knie_w2 P3 sgf sgf2
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb3==0
delete(P3);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
%% Kniekraft
hold off;
P3 = plot (sgf2,sgf);
ylim([(min(sgf)-200) (max(sgf)+200)])
index = find(sgf==max(sgf));
txt = [‘max = ‘, num2str(max(sgf)),’ N’,’ ; ‘ num2str(sgf2(index)),’ Grad’];
text(sgf2(index)-15,max(sgf)+10,txt)
%%
xlabel(‘angle of knie extension in degree’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox3
% — Executes on button press in checkbox4.
function checkbox4_Callback(hObject, eventdata, handles)
% hObject handle to checkbox4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2 d3_l P4 sgf sgf2 L t
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb4==0
delete(P4);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox5,’val’,0);
set(handles.checkbox6,’val’,0);
%% Berechnung der Winkel?nderung
%[min_sgf2,min_locs] = findpeaks((-1 * sgf2),’MinPeakDistance’,100);
%min_sgf2 = -1 * min_sgf2;
%findpeaks((-1 * sgf2),’MinPeakDistance’,100);
%
%for i = 1:length(sgf2)
% d_sgf2(i) = sgf2(i) – min_sgf2;
%end
%% Berechnung der Zeit
for i = 1:length(sgf)
t(i) = i*17/801;
end
% %% Berechnung der Leistung
% for i = min_locs:length(sgf)
% if d_sgf2(i) > 0
% P(i) = ((sgf(i) – sgf(min_locs)) * 2 * pi * L * d_sgf2 (i) / 360) / (t(i)-t(min_locs));
% else
% P(i) = NaN;
% end
% end
%% Streckungwinkel gegen Zeit
hold off;
P4 = plot (t,sgf2,’r’);
ylim([(min(sgf2)-5) (max(sgf2)+5)])
xlabel(‘time [s]’);
ylabel(‘angle of knie extension in degree’);
legend(‘Winkel der Streckung’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox4
% — Executes on button press in checkbox5.
function checkbox5_Callback(hObject, eventdata, handles)
% hObject handle to checkbox5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fx fz f_x f_r kurbel_w0_index kurbel_w
cb1=get(handles.checkbox1,’val’);
cb5=get(handles.checkbox5,’val’);
cla;
if cb1==1
close (figure(1)) ;
end
if cb5==0
cla;
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
% f_x=plot(fx, ‘m’);
% hold on
% f_z=plot(fz, ‘cyan’);
% f_r=plot(fr, ‘b’);
% hold on
% f_r=plot(fres.h1,’r’)
f_x=1:length(fx);
B = fir1(60,0.4);
% plot(h4,’r’)
% x_fir = filtfilt (B, 1, fr);
% hold on;
f_r=plot(f_x,fx,’b’,f_x,fz,’r’);
xlabel(‘Frame’);
ylabel(‘force in sensor [N]’);
legend(‘x-component’,’z-component’);
%
% cla;
% [a,b]= size(kurbel_w0_index);
% h2=zeros(length(kurbel_w0_index),359);
% h25=zeros(length(kurbel_w0_index),359);
% h26=zeros(length(kurbel_w0_index),359);
% for i=1:b-1
% j=kurbel_w0_index(i);
% % hold on
% % plot(kurbel_w(j:kurbel_w0_index(i+1)-1),fres.h1(j:kurbel_w0_index(i+1)-1))
%
% h3=fr(j:kurbel_w0_index(i+1)-1);
% h5=fx(j:kurbel_w0_index(i+1)-1);
% h6=fz(j:kurbel_w0_index(i+1)-1);
% fh(i).c=h3;
% fh5(i).c=h5;
% fh6(i).c=h6;
% h1=kurbel_w(j:kurbel_w0_index(i+1)-1);
% fh3(i).c=h1;
% % length(h1)
%
% for k=1:length(h3)
% kk=round(kurbel_w(j+k-1))-1;
% if kk<=0
% kk=1;
% end
% h2(i,kk)=(h3(k)+h2(kk));
% h25(i,kk)=(h5(k)+h25(kk));
% h26(i,kk)=(h6(k)+h26(kk));
%
% end
%
% end
%
% j=1;
% for i=1:length(h2)
% if i<21
% s1=h2(:,length(h2)-20+i:length(h2));
% s5=h25(:,length(h25)-20+i:length(h25));
% s6=h26(:,length(h26)-20+i:length(h26));
% s2=h2(:,1:i);
% s25=h25(:,1:i);
% s26=h26(:,1:i);
%
% s=[s1,s2];
% s55=[s5,s25];
% s66=[s6,s26];
% else
% s=h2(:,i-20:i);
% s55=h25(:,i-20:i);
% s66=h26(:,i-20:i);
% end
% s=s(s~=0);
% h4(i)=sum(s)/length(s);
% s55=s55(s55~=0);
% h45(i)=sum(s55)/length(s55);
% s66=s66(s66~=0);
% h46(i)=sum(s66)/length(s66);
%
% end
%
% h4(isnan(h4))=[];
% plot(h4)
% hold on
% h45(isnan(h45))=[];
% plot(h45,’r’)
% h6(isnan(h46))=[];
% plot(h46,’g’)
% % Hint: get(hObject,’Value’) returns toggle state of checkbox5
% legend(‘resultierende Pedal Kraft’,’z-Komponente’,’x-Komponente’);
end
% — Executes on button press in loeschen.
function loeschen_Callback(hObject, eventdata, handles)
% hObject handle to loeschen (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear all;
% — Executes on button press in checkbox6.
function checkbox6_Callback(hObject, eventdata, handles)
% hObject handle to checkbox6 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global knie_w2 F_res P6 sgf sgf2 t d3_l
cb1=get(handles.checkbox1,’val’);
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb5=get(handles.checkbox5,’val’);
cb6=get(handles.checkbox6,’val’);
if cb1==1 || cb5==1
cla;
close (figure(1)) ;
end
if cb6==0
delete(P6);
legend(‘off’);
else
set(handles.checkbox1,’val’,0);
set(handles.checkbox2,’val’,0);
set(handles.checkbox3,’val’,0);
set(handles.checkbox4,’val’,0);
set(handles.checkbox5,’val’,0);
%% Berechnung der Zeit
for i = 1:length(sgf2)
t(i) = i*17/801;
end
%% res. Kniekraft gegen Zeit
hold off;
P6 = plot (t,sgf,’r’);
ylim([(min(sgf)-200) (max(sgf)+200)])
index = find(sgf==max(sgf));
txt = [‘max = ‘, num2str(max(sgf)),’ N’,’ ; ‘ num2str(t(index)),’ s’];
text(t(index)-0.20,max(sgf)+40,txt)
%%
xlabel(‘time [s]’);
ylabel(‘force in knie joint [N]’);
legend(‘Kniekraft’)
end
legend_f(handles);
% Hint: get(hObject,’Value’) returns toggle state of checkbox4
% Hint: get(hObject,’Value’) returns toggle state of checkbox6
function legend_f(handles)
global x_fir_h x_fir_k x_fir_s
cb2=get(handles.checkbox2,’val’);
cb3=get(handles.checkbox3,’val’);
cb4=get(handles.checkbox4,’val’);
cb6=get(handles.checkbox6,’val’);
if cb6==1
i=1;
if cb2==1 && length(x_fir_h)==1
L{i}=’H?ftkraft’;
x_fir(i)=x_fir_h;
i=i+1;
end
if cb3==1 && length(x_fir_k)==1
L{i}=’Kniekraft’;
x_fir(i)=x_fir_k;
i=i+1;
end
if cb4==1 && length(x_fir_s)==1
L{i}=’Sprunggelenkkraft’;
x_fir(i)=x_fir_s;
i=i+1;
end
% Hint: get(hObject,’Value’) returns toggle state of checkbox6
if i>1
legend(x_fir,L);
end
end
% — Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sgf sgf2 peaks_l peaks_v knie_w2 F_res cb1
%% Summation bestimmen
%Ausw?hlen min. bzw. max. Peaks durch -1 bzw. 1 Eingabe
% close (figure(2));
if isempty(peaks_l)==1
peaks_l={‘150’};
peaks_v={‘1’};
else
peaks_l={num2str(peaks_l)};
peaks_v={num2str(peaks_v)};
end
peaks_l=inputdlg({‘please enter peaks distance’},’peaksdistance’,1,peaks_l);
peaks_l=str2num(peaks_l{1});
peaks_v=inputdlg({‘max. peaks = 1 or min. peaks = -1′},’peaksvalue’,1,peaks_v);
peaks_v=str2num(peaks_v{1});
%Suchen die min. bzw max. Winkel-Werte
[AP, locs] = findpeaks(sgolayfilt(peaks_v * knie_w2,3,51),’MinPeakDistance’,peaks_l);
AP = peaks_v * AP;
l_AP = numel (AP); %Number of AP
%plotting findpeaks
% cla;
figure(2);
findpeaks(sgolayfilt(peaks_v * knie_w2,3,51),’MinPeakDistance’,peaks_l);
xlabel(‘frame’);
ylabel(‘angle of knee extension in degree’);
legend(‘Winkel der Streckung’)
%die Messwerte der Kraft in jeden Vorgang verteilen
for i=1:l_AP;
if (i<l_AP)
K{i} = F_res(locs(i):locs(i+1));
else
K{i} = F_res(locs(i):end);
end
end
RR=padcat(K{1,:}); %die L?nge der Kraft-Werte ausgleichen
KL=nanmean(RR’); %Mittelwert berechnen
sgf = sgolayfilt(KL,3,51); %Filter
%die Messwerte der Winkel in jeden Vorgang verteilen
for i=1:l_AP;
if (i<l_AP)
WW{i} = knie_w2(locs(i):locs(i+1));
else
WW{i} = knie_w2(locs(i):end);
end
end
LL=padcat(WW{1,:}); %die L?nge der Winkel-Werte ausgleichen
WL=nanmean(LL’); %Mittelwert berechnen
sgf2 = sgolayfilt(WL,4,51); %Filter
% — Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global sgf sgf2 t knie_w2 F_res
frame = (1:length(F_res))’;
kniekraft = F_res;
kniewinkel = knie_w2;
sum_zeit = t’;
sum_kniewinkel = sgf2′;
sum_kniekraft = sgf’;
% Get the name of the file that the user wants to save.
% Note, if you’re saving an image you can use imsave() instead of uiputfile().
startingFolder = userpath; % Or "pwd" or wherever you want.
defaultFileName = fullfile(startingFolder, ‘.xlsx’);
[baseFileName, folder] = uiputfile(defaultFileName, ‘Specify a file’);
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName);
Tab1 = table(frame,kniekraft,kniewinkel);
Tab2 = table (sum_zeit,sum_kniekraft,sum_kniewinkel);
%xlswrite(fullFileName, Tab1, ‘A1’)
%xlswrite(fullFileName, Tab2, ‘D1’)
writetable(Tab1,fullFileName);
writetable(Tab2,fullFileName,’Sheet’,1,’Range’,’D1′);
Unrecognized function or variable ‘nanmean’.
Error in Ausgabe>pushbutton4_Callback (line 675)
KL=nanmean(RR’); %Mittelwert berechnen
Error in gui_mainfcn (line 90)
feval(varargin{:});
Error in Ausgabe (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)Ausgabe(‘pushbutton4_Callback’,hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback. gui MATLAB Answers — New Questions
You are not eligible for FastTrack assistance.
After purchasing E3 and E5 licenses after how many days we are eligible to request for FastTrack assistances? For me license purchased 2 days before but in Admin portal still we are getting “You are not eligible for FastTrack assistance.” Any idea?
After purchasing E3 and E5 licenses after how many days we are eligible to request for FastTrack assistances? For me license purchased 2 days before but in Admin portal still we are getting “You are not eligible for FastTrack assistance.” Any idea? Read More
Sharepoint-framework For OneDrive and Microsoft Team
Currently, I am using SharePoint Framework to add a move action on the command bar, and it’s working well. However, I can’t find a way to apply it to both OneDrive and Microsoft Teams. Does SharePoint Framework support them or not?
Currently, I am using SharePoint Framework to add a move action on the command bar, and it’s working well. However, I can’t find a way to apply it to both OneDrive and Microsoft Teams. Does SharePoint Framework support them or not? Read More
Open support ticket for Sharepoint
Hello
I have a simple question.
I like to know where I can open a support ticket for SharePoint Online without using the support hub.
I am a SharePoint Admin and try to find the direct way to open up a ticket.
In the past I used PowerPlatform or PowerBI to do that…
The support sites are very old or not usable
HelloI have a simple question.I like to know where I can open a support ticket for SharePoint Online without using the support hub.I am a SharePoint Admin and try to find the direct way to open up a ticket.In the past I used PowerPlatform or PowerBI to do that…The support sites are very old or not usable Read More
Troubleshoot Policy Issues for Sending logs to Log Analytics/Storage Account for Azure Resources
Azure Custom Policies
Azure custom policies are used to extend and customize the behavior of Azure services to meet specific requirements that are not addressed by the built-in policies.
Reference on how to fix common issues while creating custom policies can be found here : Troubleshooting Common Custom Policy Issues in Policy Development
Custom Policy for Sending logs to Log analytics workspace and Storage Account
We use custom policies to send logs to a Log Analytics workspace and a Storage Account in Azure to ensure that all required logs are consistently and automatically collected and stored for analysis, auditing, and compliance purposes. By using custom policies for sending logs to a Log Analytics workspace and Storage Account, organizations can enhance their logging and monitoring capabilities, improve security and compliance, and streamline log management processes.
How to Troubleshoot common issues in Custom Policy for sending logs to Log analytics workspace and Storage Account
While adding custom policy and assigning it to particular subscription, we might encounter multiple issues in compliance report which can be sometimes hard to understand and fix. Here is the list of Use cases and fixes which can help us quickly in identifying the root cause and solving the issues.
Use Case 1 – Logs are enabled, still resource is marked as non- compliant
Below is an example of function apps, where logs are enabled, however resource is still marked as non- compliant.
Fix: Please check the diagnostic settings and make sure that all logs are enabled as per the policy rule mentioned in your policy definition. If all Logs are not enabled, policy rule will not match with the settings, and resource will be marked as non- compliant
Now, as per below screenshot for functions apps, here we see that all logs are not enabled-
To fix this issue, please go back to policy definition and add entry for all logs here inside “logs” section. Please note that the logs category will vary for different products. Always make sure to check logs category before adding logs policy
Use Case 2- Reason for non- compliance is incorrect for the resources where logs are not enabled
There will be few cases, where you will see that resource is non-compliant however the reason for non-compliance is not correct.
Below is screenshot for reason for non-compliance, which is very common issue that has been observed in multiple products
Current Value is marked as “true” and “false” both.
Fix: To fix this issue, please check if your product has multiple logs category or not and follow below steps
1. If Resource has Multiple Logs Category
If your product has multiple logs category, then you must add “count” variable for your policy definition, so that it can check all logs, count the value and base upon that mark the resource as compliant or non-compliant
For example, here as per below screenshot, for batch account we have two different logs category, which is greater than 1. Here we need to put the count variable so that it can count total logs and then reflect correct compliance report
Here in policy definition, we have put count variable for “All logs” only in “category group” as we don’t have multiple categories for “All Metrics”. If you have multiple categories for “All Metrics”, then you can put count variable for “all metrics” as well
Please make a note to check if “All Logs” category is a part of “category group” or not. You can always check JSON view for diagnostic settings to confirm that
2. If Resource has All logs and Audit Logs
All logs category and Audit logs Category varies for each product. For few products you will notice that All logs include Audit Logs as well which means if you enable All logs, Audit logs are enabled automatically, however for few products All logs and Audit Logs category are completely different. This means you must explicitly enable All logs as well as Audit logs and add the same logic to policy definition. If you fail to do that, compliance report will mark your resources as non- complaint with reason as [true, false]. True false means, few logs are enabled, and few are not enabled.
As per the below screenshot, Logs are enabled, however Audit logs are not enabled. This is a scenario, where compliance report will mark your resource as non-compliant because logs are partially enabled, hence reason for no compliance will be true and false
Also, where no logs are enabled, resource will be marked as non- compliant, with same reason as true and false because policy definition is only checking All logs and not Audit logs
Fix: To fix this issue, please update your policy definition to include Audit logs as well after rechecking JSON view of diagnostic settings and getting confirmation that category groups are separately defined for Audit and All logs as per below screenshot
Updated policy definition will look like this
Once you update the policy definition, you will see the compliance report is marked with correct reason for non-compliant resources where no logs are enabled. Compliant reason will look like this
Also, for resources, where logs are enabled partially, once remediation task is run, logs will be enabled fully, and resources will be marked as compliant.
Use case 3 – If there are no multiple logs category and non-compliant reason is misleading
If your non-compliant resource is showing reason as “true, false” and the above-mentioned Use case is not matching the criteria, then try to add same policy in some other subscription and check the reason for compliance, if the reason for non-compliant is changing then we have to check the HAR trace logs for checking the values for get and post requests and take a decision.
There might be a possibility that it is a UI issue, and you must connect with PG team to understand the fix for the same
For example, please see below screenshot for logs policy. Here the non-compliant reason changes in two different subscriptions however the policy for sending logs to log analytics remains same in logic for both subscriptions.
In First screenshot reason for non-compliance is blank however in second screenshot for same policy, reason for non-compliance is blank but it says “no related resources match the effect detail which is misleading. This is UI issue; policy logic is correct here.
Microsoft Tech Community – Latest Blogs –Read More
RAGHack: Free global hackathon Sept 3-13
By far, one of the most popular uses of large language models is RAG: Retrieval Augmented Generation. RAG (Retrieval Augmented Generation) combines the power of large language models with the knowledge of a search engine. This allows you to ask questions of your own data and get answers that are relevant to the context of your question.
We want to empower all developers to build RAG applications, so we’re excited to announce RAGHack:
a global hackathon with live streams, prizes, and advice from experts.
RAGHack is your opportunity to get deep into RAG and start building with RAG yourself. Across 25+ live streams, we’ll show you how to build RAG applications on top of Azure AI in multiple languages (Python, Java, JS, C#) with multiple retrievers (AI Search, PostgreSQL, Azure SQL, Cosmos DB), with your own data sources! You’ll learn about the most popular frameworks, like LangChain and Semantic Kernel, plus the latest technology, like agents and vision models.
The possibilities are endless for what you can create… plus you can submit your hack for a chance to win exciting prizes!
:trophy: We’ll reward prizes in these 10 categories:
Best overall
Best in JavaScript
Best in Java
Best in .NET
Best in Python
Best use of AI Studio
Best use of AI Search
Best use of PostgreSQL
Best use of Cosmos DB
Best use of Azure SQL
✍🏽 Register for the hackathon from the Reactor series page. That will register you for both the live streams and the hackathon.
:globe_showing_americas: If you speak Spanish, Portuguese, or Chinese, we’ll also have streams and support from experts in those languages, and we’d love to see submissions in your own language. Register for those streams here.
Microsoft Tech Community – Latest Blogs –Read More
Transfer Function of a RLC circuit 2 loop
how i can get a Transfer Function of a RLC circuit 2 loop if i want the output currenthow i can get a Transfer Function of a RLC circuit 2 loop if i want the output current how i can get a Transfer Function of a RLC circuit 2 loop if i want the output current transfer function of a rlc circuit 2 loop MATLAB Answers — New Questions
Latest Threat Intelligence (August 2024)
Microsoft Defender for IoT has released the August 2024 Threat Intelligence package. The package is available for download from the Microsoft Defender for IoT portal (click Updates, then Download file).
Threat Intelligence updates reflect the combined impact of proprietary research and threat intelligence carried out by Microsoft security teams. Each package contains the latest CVEs (Common Vulnerabilities and Exposures), IOCs (Indicators of Compromise), and other indicators applicable to IoT/ICS/OT networks (published during the past month) researched and implemented by Microsoft Threat Intelligence Research – CPS.
The CVE scores are aligned with the National Vulnerability Database (NVD). Starting with the August 2023 threat intelligence updates, CVSSv3 scores are shown if they are relevant; otherwise the CVSSv2 scores are shown.
Guidance
Customers are recommended to update their systems with the latest TI package in order to detect potential exposure risks and vulnerabilities in their networks and on their devices. Threat Intelligence packages are updated every month with the most up-to-date security information available, ensuring that Microsoft Defender for IoT can identify malicious actors and behaviors on devices.
Update your system with the latest TI package
The package is available for download from the Microsoft Defender for IoT portal (click Updates, then Download file), for more information, please review Update threat intelligence data | Microsoft Docs.
MD5 Hash: 1b0b3742c28c70692504dcf88d63d54c
For cloud connected sensors, Microsoft Defender for IoT can automatically update new threat intelligence packages following their release, click here for more information. Read More
Loop has a new URL
Hi there guys. I’ve been stuck at the “Loop has a new URL” and cannot get out of it. Clearing cache/cookies doesn’t help and neither does switching browser. Any ideas? I have tried from my business account as well as from my personal account. Going to my Office 365 list of apps and selecting it from there, also results in thame issue. Please help.
Hi there guys. I’ve been stuck at the “Loop has a new URL” and cannot get out of it. Clearing cache/cookies doesn’t help and neither does switching browser. Any ideas? I have tried from my business account as well as from my personal account. Going to my Office 365 list of apps and selecting it from there, also results in thame issue. Please help. Read More
Disable automatic generation of OneNote when clicking on “Notes” Tab in Teams
Hello There
When I click in Teams on the “Notes” Tab, it will automatically generate a OneNote:
I don’t want to disable notes completely. If I click on the Notes Tab, I would like to manually create a OneNote Notebook manually in case I need one.
Any Suggestions?
Thanks in Advance
kind regards
Jonas
Hello There When I click in Teams on the “Notes” Tab, it will automatically generate a OneNote: I don’t want to disable notes completely. If I click on the Notes Tab, I would like to manually create a OneNote Notebook manually in case I need one. Any Suggestions? Thanks in Advance kind regardsJonas Read More
Windows defender
Windows Defender is completely missing from my pc.
Can anyone plsz help me out
Windows Defender is completely missing from my pc.Can anyone plsz help me out Read More