Category: News
How to optimize a bi-exponential signal fitting?
Hi everybody!
I’m trying to solve a fitting curve problem concerning a double-exponential fit.
I have this data set (Data.txt) that behaves like a bi-exponential function following a resting condition. Therefore, since x<0 the signal is almost steady whereas, for x>0 the signal presents a first exponential phase (lasting about 20 sec) followed by a second exponential phase.
The problem is that the resulting fitting does not model the signal behavior in the correct way. Specifically, the first exp phase is too short and/or too low even though correct StartingPoint and Upper and Lower limits are set.
Lastly, I’ve written two algorithms with and without "Exclude" options. The second one presents a strange pattern at the onset of the second exp function.
I’ll appreciate any suggestions.
This is the code.
[x, y] = readvars(‘prova.txt’);
tRest = abs(min(x)); % Resting phase duration (sec)
cdp = 20; % estimated duration (sec) of CardioDynamicPhase (cdp)
cdpEpoch = 5; % epoch duration (sec) to compute mean value of amplitude of cdp
plot(x,y);
% Fitting StartingPoint
yRest = mean( y(1:tRest-1) ); % y value at resting condition before exp onset
A1start = mean( y(1:tRest+cdp-cdpEpoch):y(tRest+cdp) )-yRest; % mean y value of the last 5sec of the cardiodynamic phase
TD1start = 0; % starting value (sec) of the first exponential phase onset
tau1Start = 8; % starting value (sec) of the first exponential phase time constant
A2start = max(y)-A1start-yRest; % starting value of the second exponential phase amplitude
TD2start = 30; % starting value (sec) of the second exponential phase onset
tau2Start = 30; % starting value (sec) of the second exponential phase time constant
% Fitting from exponential onset
g = fittype( @(A1, TD1, tau1, A2, TD2, tau2, yRest, x) yRest+A1.*(1-exp(-(x-TD1)/tau1))+A2.*(1-exp(-(x-TD2)/tau2)), ‘problem’, ‘yRest’);
f1 = fit( x(tRest:size(x,1)), y(tRest:size(x,1)), g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ A1start-100, 0, 5, A2start-200, 10, 10], ‘upper’, [ A1start+200, 20, 40, max(y), 60, 40], ‘MaxIter’, 10000);
pg =coeffvalues(f1);
A1 = pg(1);
TD1 = pg(2);
tau1 = pg(3);
A2 = pg(4);
TD2 = pg(5);
tau2 = pg(6);
yFit( 1:(tRest+floor(TD1)) ) = yRest;
yFit( tRest+floor(TD1)+1 : tRest+floor(TD2) ) = yRest + A1.*(1-exp(-( x(tRest+floor(TD1)+1 : tRest+floor(TD2))-TD1 )/tau1));
yFit( tRest+floor(TD2)+1 : size(y,1)) = yFit(tRest+floor(TD2))+ A2.*(1-exp(-( x(tRest+floor(TD2)+1 : size(y,1))-TD2 )/tau2));
% fitting using Exclude option
f2 = fit( x, y, g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ 390, 0, 5, A2start-200, 10, 10], ‘upper’, [ 400, 20, 40, max(y), 60, 40], ‘Exclude’, x<0); %Same fitting algortihm that exclude negative x values
pg2=coeffvalues(f2);
A1e = pg2(1);
TD1e = pg2(2);
tau1e = pg2(3);
A2e = pg2(4);
TD2e = pg2(5);
tau2e = pg2(6);
yFite( 1:(tRest+floor(TD1e)) ) = yRest;
yFite( tRest+floor(TD1e)+1 : tRest+floor(TD2e) ) = yRest + A1e.*(1-exp(-( x(tRest+floor(TD1e)+1 : tRest+floor(TD2e))-TD1e )/tau1e));
yFite( tRest+floor(TD2e)+1 : size(y,1)) = yFit(tRest+floor(TD2e))+ A2e.*(1-exp(-( x(tRest+floor(TD2e)+1 : size(y,1))-TD2e )/tau2e));
% Plot the fitting curves
hold on
plot (x, yFit, ‘r’);
plot (x, yFite, ‘k’);Hi everybody!
I’m trying to solve a fitting curve problem concerning a double-exponential fit.
I have this data set (Data.txt) that behaves like a bi-exponential function following a resting condition. Therefore, since x<0 the signal is almost steady whereas, for x>0 the signal presents a first exponential phase (lasting about 20 sec) followed by a second exponential phase.
The problem is that the resulting fitting does not model the signal behavior in the correct way. Specifically, the first exp phase is too short and/or too low even though correct StartingPoint and Upper and Lower limits are set.
Lastly, I’ve written two algorithms with and without "Exclude" options. The second one presents a strange pattern at the onset of the second exp function.
I’ll appreciate any suggestions.
This is the code.
[x, y] = readvars(‘prova.txt’);
tRest = abs(min(x)); % Resting phase duration (sec)
cdp = 20; % estimated duration (sec) of CardioDynamicPhase (cdp)
cdpEpoch = 5; % epoch duration (sec) to compute mean value of amplitude of cdp
plot(x,y);
% Fitting StartingPoint
yRest = mean( y(1:tRest-1) ); % y value at resting condition before exp onset
A1start = mean( y(1:tRest+cdp-cdpEpoch):y(tRest+cdp) )-yRest; % mean y value of the last 5sec of the cardiodynamic phase
TD1start = 0; % starting value (sec) of the first exponential phase onset
tau1Start = 8; % starting value (sec) of the first exponential phase time constant
A2start = max(y)-A1start-yRest; % starting value of the second exponential phase amplitude
TD2start = 30; % starting value (sec) of the second exponential phase onset
tau2Start = 30; % starting value (sec) of the second exponential phase time constant
% Fitting from exponential onset
g = fittype( @(A1, TD1, tau1, A2, TD2, tau2, yRest, x) yRest+A1.*(1-exp(-(x-TD1)/tau1))+A2.*(1-exp(-(x-TD2)/tau2)), ‘problem’, ‘yRest’);
f1 = fit( x(tRest:size(x,1)), y(tRest:size(x,1)), g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ A1start-100, 0, 5, A2start-200, 10, 10], ‘upper’, [ A1start+200, 20, 40, max(y), 60, 40], ‘MaxIter’, 10000);
pg =coeffvalues(f1);
A1 = pg(1);
TD1 = pg(2);
tau1 = pg(3);
A2 = pg(4);
TD2 = pg(5);
tau2 = pg(6);
yFit( 1:(tRest+floor(TD1)) ) = yRest;
yFit( tRest+floor(TD1)+1 : tRest+floor(TD2) ) = yRest + A1.*(1-exp(-( x(tRest+floor(TD1)+1 : tRest+floor(TD2))-TD1 )/tau1));
yFit( tRest+floor(TD2)+1 : size(y,1)) = yFit(tRest+floor(TD2))+ A2.*(1-exp(-( x(tRest+floor(TD2)+1 : size(y,1))-TD2 )/tau2));
% fitting using Exclude option
f2 = fit( x, y, g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ 390, 0, 5, A2start-200, 10, 10], ‘upper’, [ 400, 20, 40, max(y), 60, 40], ‘Exclude’, x<0); %Same fitting algortihm that exclude negative x values
pg2=coeffvalues(f2);
A1e = pg2(1);
TD1e = pg2(2);
tau1e = pg2(3);
A2e = pg2(4);
TD2e = pg2(5);
tau2e = pg2(6);
yFite( 1:(tRest+floor(TD1e)) ) = yRest;
yFite( tRest+floor(TD1e)+1 : tRest+floor(TD2e) ) = yRest + A1e.*(1-exp(-( x(tRest+floor(TD1e)+1 : tRest+floor(TD2e))-TD1e )/tau1e));
yFite( tRest+floor(TD2e)+1 : size(y,1)) = yFit(tRest+floor(TD2e))+ A2e.*(1-exp(-( x(tRest+floor(TD2e)+1 : size(y,1))-TD2e )/tau2e));
% Plot the fitting curves
hold on
plot (x, yFit, ‘r’);
plot (x, yFite, ‘k’); Hi everybody!
I’m trying to solve a fitting curve problem concerning a double-exponential fit.
I have this data set (Data.txt) that behaves like a bi-exponential function following a resting condition. Therefore, since x<0 the signal is almost steady whereas, for x>0 the signal presents a first exponential phase (lasting about 20 sec) followed by a second exponential phase.
The problem is that the resulting fitting does not model the signal behavior in the correct way. Specifically, the first exp phase is too short and/or too low even though correct StartingPoint and Upper and Lower limits are set.
Lastly, I’ve written two algorithms with and without "Exclude" options. The second one presents a strange pattern at the onset of the second exp function.
I’ll appreciate any suggestions.
This is the code.
[x, y] = readvars(‘prova.txt’);
tRest = abs(min(x)); % Resting phase duration (sec)
cdp = 20; % estimated duration (sec) of CardioDynamicPhase (cdp)
cdpEpoch = 5; % epoch duration (sec) to compute mean value of amplitude of cdp
plot(x,y);
% Fitting StartingPoint
yRest = mean( y(1:tRest-1) ); % y value at resting condition before exp onset
A1start = mean( y(1:tRest+cdp-cdpEpoch):y(tRest+cdp) )-yRest; % mean y value of the last 5sec of the cardiodynamic phase
TD1start = 0; % starting value (sec) of the first exponential phase onset
tau1Start = 8; % starting value (sec) of the first exponential phase time constant
A2start = max(y)-A1start-yRest; % starting value of the second exponential phase amplitude
TD2start = 30; % starting value (sec) of the second exponential phase onset
tau2Start = 30; % starting value (sec) of the second exponential phase time constant
% Fitting from exponential onset
g = fittype( @(A1, TD1, tau1, A2, TD2, tau2, yRest, x) yRest+A1.*(1-exp(-(x-TD1)/tau1))+A2.*(1-exp(-(x-TD2)/tau2)), ‘problem’, ‘yRest’);
f1 = fit( x(tRest:size(x,1)), y(tRest:size(x,1)), g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ A1start-100, 0, 5, A2start-200, 10, 10], ‘upper’, [ A1start+200, 20, 40, max(y), 60, 40], ‘MaxIter’, 10000);
pg =coeffvalues(f1);
A1 = pg(1);
TD1 = pg(2);
tau1 = pg(3);
A2 = pg(4);
TD2 = pg(5);
tau2 = pg(6);
yFit( 1:(tRest+floor(TD1)) ) = yRest;
yFit( tRest+floor(TD1)+1 : tRest+floor(TD2) ) = yRest + A1.*(1-exp(-( x(tRest+floor(TD1)+1 : tRest+floor(TD2))-TD1 )/tau1));
yFit( tRest+floor(TD2)+1 : size(y,1)) = yFit(tRest+floor(TD2))+ A2.*(1-exp(-( x(tRest+floor(TD2)+1 : size(y,1))-TD2 )/tau2));
% fitting using Exclude option
f2 = fit( x, y, g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ 390, 0, 5, A2start-200, 10, 10], ‘upper’, [ 400, 20, 40, max(y), 60, 40], ‘Exclude’, x<0); %Same fitting algortihm that exclude negative x values
pg2=coeffvalues(f2);
A1e = pg2(1);
TD1e = pg2(2);
tau1e = pg2(3);
A2e = pg2(4);
TD2e = pg2(5);
tau2e = pg2(6);
yFite( 1:(tRest+floor(TD1e)) ) = yRest;
yFite( tRest+floor(TD1e)+1 : tRest+floor(TD2e) ) = yRest + A1e.*(1-exp(-( x(tRest+floor(TD1e)+1 : tRest+floor(TD2e))-TD1e )/tau1e));
yFite( tRest+floor(TD2e)+1 : size(y,1)) = yFit(tRest+floor(TD2e))+ A2e.*(1-exp(-( x(tRest+floor(TD2e)+1 : size(y,1))-TD2e )/tau2e));
% Plot the fitting curves
hold on
plot (x, yFit, ‘r’);
plot (x, yFite, ‘k’); signal fitting MATLAB Answers — New Questions
changes for MSK to GMSK in MATLAB example
Hi, In this example, what all changes we need to make for recovering a GMSK signal. openExample(‘comm/MSKSignalRecoveryInSimulinkExample’)
Im getting a high BER value. despite changing the GMSK modulator and demodulator, and GMSK tsignal timing recovery block.Hi, In this example, what all changes we need to make for recovering a GMSK signal. openExample(‘comm/MSKSignalRecoveryInSimulinkExample’)
Im getting a high BER value. despite changing the GMSK modulator and demodulator, and GMSK tsignal timing recovery block. Hi, In this example, what all changes we need to make for recovering a GMSK signal. openExample(‘comm/MSKSignalRecoveryInSimulinkExample’)
Im getting a high BER value. despite changing the GMSK modulator and demodulator, and GMSK tsignal timing recovery block. gmsk, msk, signal recovery, ber MATLAB Answers — New Questions
I have PDF files on my PC that I’d like to combine into one PDF. How can I save them all in one PDF?
I have many PDF files saved on my computer, some of which are placed on the desktop, while others are in other folders. Feeling interested in placing them together to manage in one single PDF file, I went to Google to seek directions on how to do it. From that point on, Google provided several tools for merging PDFs. I tested out a few of the tools that Google suggested, but unfortunately, they do not support Windows 10, which is something I wanted because I am using Windows 10 on my computer. After that, I discovered the Pcinfotools PDF Merge Software, which combined all of my PDF files into one.
I have many PDF files saved on my computer, some of which are placed on the desktop, while others are in other folders. Feeling interested in placing them together to manage in one single PDF file, I went to Google to seek directions on how to do it. From that point on, Google provided several tools for merging PDFs. I tested out a few of the tools that Google suggested, but unfortunately, they do not support Windows 10, which is something I wanted because I am using Windows 10 on my computer. After that, I discovered the Pcinfotools PDF Merge Software, which combined all of my PDF files into one. Read More
How can I download audiobooks on Spotify to my Windows PC?
Hi,
I’ve recently started exploring the audiobook collection on Spotify and found some great titles that I’d like to listen to offline. However, since I don’t have a Spotify Premium account, I’m unsure how to download them directly to my computer.
I’m familiar with various software tools and converters, as I often use them in my work as a technical writer, but I’m not sure which one would work best for this specific task. Ideally, I’m looking for a method that can download audiobooks on Spotify in a format compatible with my PC, without compromising the quality.
Hi, I’ve recently started exploring the audiobook collection on Spotify and found some great titles that I’d like to listen to offline. However, since I don’t have a Spotify Premium account, I’m unsure how to download them directly to my computer. I’m familiar with various software tools and converters, as I often use them in my work as a technical writer, but I’m not sure which one would work best for this specific task. Ideally, I’m looking for a method that can download audiobooks on Spotify in a format compatible with my PC, without compromising the quality. Read More
Error in port widths or dimensions.
Error in port widths or dimensions. Output port 1 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/From2’ is a one dimensional vector with 2 elements.
AND
Error in port widths or dimensions. Invalid dimension has been specified for input port 2 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/Mux’.
I am using MATLAB 2010a. problem occurred in the switching circuit of invert.
Anticipating your answers…
<</matlabcentral/answers/uploaded_files/38534/1.png>>
<</matlabcentral/answers/uploaded_files/38535/2.png>>Error in port widths or dimensions. Output port 1 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/From2’ is a one dimensional vector with 2 elements.
AND
Error in port widths or dimensions. Invalid dimension has been specified for input port 2 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/Mux’.
I am using MATLAB 2010a. problem occurred in the switching circuit of invert.
Anticipating your answers…
<</matlabcentral/answers/uploaded_files/38534/1.png>>
<</matlabcentral/answers/uploaded_files/38535/2.png>> Error in port widths or dimensions. Output port 1 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/From2’ is a one dimensional vector with 2 elements.
AND
Error in port widths or dimensions. Invalid dimension has been specified for input port 2 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/Mux’.
I am using MATLAB 2010a. problem occurred in the switching circuit of invert.
Anticipating your answers…
<</matlabcentral/answers/uploaded_files/38534/1.png>>
<</matlabcentral/answers/uploaded_files/38535/2.png>> MATLAB Answers — New Questions
Give me a matlab code for plotting graph and solving the BVP. using Keller Box Method f^iv+R(f’f”-ff”’)=0 with boundary conditions f'(1)=-Φf”(0) ,f”(0)=0 ,f(0)=0,f(1)=1
…… … keller box method, matlab code MATLAB Answers — New Questions
how to fix an error:” error in port widths or dimensions.”
Hello everyone,
I made a state space representation with disturbances using blocks in simulink, then I connected this state space to model predictive control, and when I run the system it gives an error as shown below: the red spot in the figure is where the error is,
and my state space model is as follow:
so A, B, C and D and Bd should be correct as I made them, right?Hello everyone,
I made a state space representation with disturbances using blocks in simulink, then I connected this state space to model predictive control, and when I run the system it gives an error as shown below: the red spot in the figure is where the error is,
and my state space model is as follow:
so A, B, C and D and Bd should be correct as I made them, right? Hello everyone,
I made a state space representation with disturbances using blocks in simulink, then I connected this state space to model predictive control, and when I run the system it gives an error as shown below: the red spot in the figure is where the error is,
and my state space model is as follow:
so A, B, C and D and Bd should be correct as I made them, right? matlab, simulink, model predictive controller, state space representation MATLAB Answers — New Questions
iam unable to see output for open ciruit voltage of pv array. it is showing as ”nan”
Post Content Post Content unable to get output MATLAB Answers — New Questions
MS Access- Validation for post codes
Please help. I’ve been on this for 3-4 days now!
the postcodes are 4 digits… (data is in short text)
I’m trying to set up a validation rule : is null or like “####” to only enable number input or leave it blank.
no matter what I put in… numbers, letters, space… i’m getting the validation msg I set up (please enter 4 digit code)
even when I try to change the existing data (short text) same thing…
I got an error msg when trying to save this that existing data doesn’t match (seriously … just numbers in short text form)
I’m going outta my mind pls help
Please help. I’ve been on this for 3-4 days now!the postcodes are 4 digits… (data is in short text)I’m trying to set up a validation rule : is null or like “####” to only enable number input or leave it blank. no matter what I put in… numbers, letters, space… i’m getting the validation msg I set up (please enter 4 digit code) even when I try to change the existing data (short text) same thing… I got an error msg when trying to save this that existing data doesn’t match (seriously … just numbers in short text form) I’m going outta my mind pls help Read More
reckon function query
Hi i am looking to try calculate the latitude and longitude of a point on the ground with respect to an aircraft which has a lat lon but obviously at a specific height, a azmiuth and elevation look angle and also range to the point on ground ( all known ) .
[latout, lonout] = reckon(lat, lon, rng, az)
e.g from help section
dist = nm2deg(600) % convert nm distance to degrees
dist =
9.9933
pt1 = reckon(51.5,0,dist,315) % northwest is 315 degrees
pt1 =
57.8999 -13.3507
The reckon function seems to do near enough exactly what i want but does not take in account elevation angle ( i.e assumes both points are on the ground)
Is there any function similar that i can achieve being able to add in an elevation angle to the calculation, or change the reckon function in anyway?
Any help much appreciatedHi i am looking to try calculate the latitude and longitude of a point on the ground with respect to an aircraft which has a lat lon but obviously at a specific height, a azmiuth and elevation look angle and also range to the point on ground ( all known ) .
[latout, lonout] = reckon(lat, lon, rng, az)
e.g from help section
dist = nm2deg(600) % convert nm distance to degrees
dist =
9.9933
pt1 = reckon(51.5,0,dist,315) % northwest is 315 degrees
pt1 =
57.8999 -13.3507
The reckon function seems to do near enough exactly what i want but does not take in account elevation angle ( i.e assumes both points are on the ground)
Is there any function similar that i can achieve being able to add in an elevation angle to the calculation, or change the reckon function in anyway?
Any help much appreciated Hi i am looking to try calculate the latitude and longitude of a point on the ground with respect to an aircraft which has a lat lon but obviously at a specific height, a azmiuth and elevation look angle and also range to the point on ground ( all known ) .
[latout, lonout] = reckon(lat, lon, rng, az)
e.g from help section
dist = nm2deg(600) % convert nm distance to degrees
dist =
9.9933
pt1 = reckon(51.5,0,dist,315) % northwest is 315 degrees
pt1 =
57.8999 -13.3507
The reckon function seems to do near enough exactly what i want but does not take in account elevation angle ( i.e assumes both points are on the ground)
Is there any function similar that i can achieve being able to add in an elevation angle to the calculation, or change the reckon function in anyway?
Any help much appreciated reckon MATLAB Answers — New Questions
How do I fix Simulink.DataType object not in scope while using c caller?
I am using c caller and function used in that is pid controller. While simulating that its showing error like "Unable to resolve ‘PID_vars’ to a valid type for input port 0 of ‘pidexmpl/C Caller’.
Caused by:
Simulink.DataType object ‘PID_vars’ is not in scope from ‘pidexmpl/C Caller’". Can someone tell me how to resolve this error?I am using c caller and function used in that is pid controller. While simulating that its showing error like "Unable to resolve ‘PID_vars’ to a valid type for input port 0 of ‘pidexmpl/C Caller’.
Caused by:
Simulink.DataType object ‘PID_vars’ is not in scope from ‘pidexmpl/C Caller’". Can someone tell me how to resolve this error? I am using c caller and function used in that is pid controller. While simulating that its showing error like "Unable to resolve ‘PID_vars’ to a valid type for input port 0 of ‘pidexmpl/C Caller’.
Caused by:
Simulink.DataType object ‘PID_vars’ is not in scope from ‘pidexmpl/C Caller’". Can someone tell me how to resolve this error? #c caller, #simulink.datatype MATLAB Answers — New Questions
Save entire Simulink model by MATLAB command
Hi, Simulink supporters team
I want to print my Entire model as pdf by MATLAB script instead of By Print Option in Simulnik Toolstrip. I have tried 2 ways:
1.Using print( ) function but it only print first page of my model
2. Using exportgraphics( ) but it does not support for Simulink model.
So, is there any way to solve this problem?Hi, Simulink supporters team
I want to print my Entire model as pdf by MATLAB script instead of By Print Option in Simulnik Toolstrip. I have tried 2 ways:
1.Using print( ) function but it only print first page of my model
2. Using exportgraphics( ) but it does not support for Simulink model.
So, is there any way to solve this problem? Hi, Simulink supporters team
I want to print my Entire model as pdf by MATLAB script instead of By Print Option in Simulnik Toolstrip. I have tried 2 ways:
1.Using print( ) function but it only print first page of my model
2. Using exportgraphics( ) but it does not support for Simulink model.
So, is there any way to solve this problem? print, model, matlab, command MATLAB Answers — New Questions
How to interface simulink and display with GC9A01A driver from waveshare?
I recently bought a waveshare 1.28 inch round display. I use a raspberry pi model 4 b as my micro controller. I have been able to diplsy texts and images using C and python. But I would like to do the same using simulink. I wanna be able to deply the code and have the display show some text or image based on certain button being pressed. It uses SPI communication. Can someone help me with how to do this?I recently bought a waveshare 1.28 inch round display. I use a raspberry pi model 4 b as my micro controller. I have been able to diplsy texts and images using C and python. But I would like to do the same using simulink. I wanna be able to deply the code and have the display show some text or image based on certain button being pressed. It uses SPI communication. Can someone help me with how to do this? I recently bought a waveshare 1.28 inch round display. I use a raspberry pi model 4 b as my micro controller. I have been able to diplsy texts and images using C and python. But I would like to do the same using simulink. I wanna be able to deply the code and have the display show some text or image based on certain button being pressed. It uses SPI communication. Can someone help me with how to do this? spi, gc9a01a, raspberry pi, simulink MATLAB Answers — New Questions
Parameter passing to KQL functions in Defender XDR – Body of the callable expression cannot be empty
Hi all,
In the name of maintainability, I’m trying to create functions so I don’t need to repeat myself in queries and they can all be maintained in one place.
For example, I’d like to create a function that maps a device name back to the last logged in user.
This works fine if its a query, (that is it returns results as expected if I call the function after the definition in the same file) e.g.
However, if i try saving this as a function, and then calling that from another query, I get this error:
Can anyone explain what I’m doing wrong? I’ve tried a simpler example, which also gives me the same error:
Can anyone identify what I’m doing wrong here?
Cheers,
Mitch
Hi all, In the name of maintainability, I’m trying to create functions so I don’t need to repeat myself in queries and they can all be maintained in one place. For example, I’d like to create a function that maps a device name back to the last logged in user. This works fine if its a query, (that is it returns results as expected if I call the function after the definition in the same file) e.g. However, if i try saving this as a function, and then calling that from another query, I get this error: Can anyone explain what I’m doing wrong? I’ve tried a simpler example, which also gives me the same error: Can anyone identify what I’m doing wrong here?Cheers, Mitch Read More
Android Device Enrollment Restriction- All Users Option Missing
We currently have a 3rd party MDM and are in the process of design and setup of the Intune solution. I wanted to create a default deny-all enrollment policy for personal devices until we get a solution developed so that personal smart devices don’t end up in Intune.
I set up the restriction policies for Windows, IOS and MacOS and assigned them to “All Users” just fine. When trying to do so for Android devices, the “All Users” option is missing. I have checked the all devices section and there are no devices enrolled.
Any thoughts? Thanks.
We currently have a 3rd party MDM and are in the process of design and setup of the Intune solution. I wanted to create a default deny-all enrollment policy for personal devices until we get a solution developed so that personal smart devices don’t end up in Intune. I set up the restriction policies for Windows, IOS and MacOS and assigned them to “All Users” just fine. When trying to do so for Android devices, the “All Users” option is missing. I have checked the all devices section and there are no devices enrolled. Any thoughts? Thanks. Read More
B2B Invite error
Hi,
Have been trying to invite some external users using the https://learn.microsoft.com/en-us/entra/external-id/bulk-invite-powershell.
When trying to run this line
$messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo
I get this error
New-Object: Cannot find type [Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo]: verify that the assembly containing this type is loaded.
I have tried uninstalling and reinstalling the Microsoft.Graph module.
Any ideas what I am doing wrong?
Thanks
Hi, Have been trying to invite some external users using the https://learn.microsoft.com/en-us/entra/external-id/bulk-invite-powershell.When trying to run this line $messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfoI get this errorNew-Object: Cannot find type [Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo]: verify that the assembly containing this type is loaded. I have tried uninstalling and reinstalling the Microsoft.Graph module.Any ideas what I am doing wrong? Thanks Read More
Navigation Pane drag and drop to move
I am at a loss to understand why Outlook (new) doesn’t provided for a drag and drop feature so as to move folders and subfolders for quick organization. Being a convert to Windows from Apple, I am surprised to say the least. Apple mail has had this feature since inception. If you have a lot of Sub-folders then it gets really confusing to move them manually. Please correct me if this feature is offered or if not, is Outlook doing anything about it?
I am at a loss to understand why Outlook (new) doesn’t provided for a drag and drop feature so as to move folders and subfolders for quick organization. Being a convert to Windows from Apple, I am surprised to say the least. Apple mail has had this feature since inception. If you have a lot of Sub-folders then it gets really confusing to move them manually. Please correct me if this feature is offered or if not, is Outlook doing anything about it? Read More
ADSR Audio Envelope: How to get it?
How can I get the ADSR sample points of a audio file…Like:
"Fake" example:
[Amp, SR] = audioread(audio.file);
[a d s r] = get_ADSR(Amp);
% Results: The sample position of the Amp vector:
a = 85 % End of Attack -> Attack start = Amp(0)
d = 300 % End of Decay
s = 2456 % End of Sustain
r = 50000 % End of ReleaseHow can I get the ADSR sample points of a audio file…Like:
"Fake" example:
[Amp, SR] = audioread(audio.file);
[a d s r] = get_ADSR(Amp);
% Results: The sample position of the Amp vector:
a = 85 % End of Attack -> Attack start = Amp(0)
d = 300 % End of Decay
s = 2456 % End of Sustain
r = 50000 % End of Release How can I get the ADSR sample points of a audio file…Like:
"Fake" example:
[Amp, SR] = audioread(audio.file);
[a d s r] = get_ADSR(Amp);
% Results: The sample position of the Amp vector:
a = 85 % End of Attack -> Attack start = Amp(0)
d = 300 % End of Decay
s = 2456 % End of Sustain
r = 50000 % End of Release envelope, adsr, audio, wave MATLAB Answers — New Questions
App UIFigure Visibility Bug
I have Multi-Windows Application written with GUIDE. Currently I Tried to Migrate to App Designer.
My Problem: I Design An App, That Its Visibility Turned Off In App Startup Callback.
In Some Place, I Change The Position of That Windows (In Other Program Module), But Before User Decide to Click A Menu to show That App.
Its Very Odd That, The Windows Appears As Soon As Position Changed. I Tried to Turn It Visiblity Back to Off Again After Position Change Line. But It Didnt Work. Also Functions Like drawnow not useful (At First I Thought It is An Incomplete rendering problem).
This Is Secondary Windows That Should Be Invisible (app2):
function startupFcn(app)
app.UIFigure.Visible= "off"
end
In Master App, I Define ap2 Public Variable:
function startupFcn(app)
app.ap2= app2
end
And This Is Position Change In Some Callback That Tend To Show app2:
function ChangePositionButtonPushed(app, event)
app.ap2.UIFigure.Position= [100, 100, 1000, 700];
app.ap2.UIFigure.Visible
end
As you see, The 2nd Line Echo "off" Value for ap2.UIFigure, While It is shown.I have Multi-Windows Application written with GUIDE. Currently I Tried to Migrate to App Designer.
My Problem: I Design An App, That Its Visibility Turned Off In App Startup Callback.
In Some Place, I Change The Position of That Windows (In Other Program Module), But Before User Decide to Click A Menu to show That App.
Its Very Odd That, The Windows Appears As Soon As Position Changed. I Tried to Turn It Visiblity Back to Off Again After Position Change Line. But It Didnt Work. Also Functions Like drawnow not useful (At First I Thought It is An Incomplete rendering problem).
This Is Secondary Windows That Should Be Invisible (app2):
function startupFcn(app)
app.UIFigure.Visible= "off"
end
In Master App, I Define ap2 Public Variable:
function startupFcn(app)
app.ap2= app2
end
And This Is Position Change In Some Callback That Tend To Show app2:
function ChangePositionButtonPushed(app, event)
app.ap2.UIFigure.Position= [100, 100, 1000, 700];
app.ap2.UIFigure.Visible
end
As you see, The 2nd Line Echo "off" Value for ap2.UIFigure, While It is shown. I have Multi-Windows Application written with GUIDE. Currently I Tried to Migrate to App Designer.
My Problem: I Design An App, That Its Visibility Turned Off In App Startup Callback.
In Some Place, I Change The Position of That Windows (In Other Program Module), But Before User Decide to Click A Menu to show That App.
Its Very Odd That, The Windows Appears As Soon As Position Changed. I Tried to Turn It Visiblity Back to Off Again After Position Change Line. But It Didnt Work. Also Functions Like drawnow not useful (At First I Thought It is An Incomplete rendering problem).
This Is Secondary Windows That Should Be Invisible (app2):
function startupFcn(app)
app.UIFigure.Visible= "off"
end
In Master App, I Define ap2 Public Variable:
function startupFcn(app)
app.ap2= app2
end
And This Is Position Change In Some Callback That Tend To Show app2:
function ChangePositionButtonPushed(app, event)
app.ap2.UIFigure.Position= [100, 100, 1000, 700];
app.ap2.UIFigure.Visible
end
As you see, The 2nd Line Echo "off" Value for ap2.UIFigure, While It is shown. appdesigner, uifigure, visible, bug MATLAB Answers — New Questions
Accelerometer reading of pixhawk 6X using MATLAB 2024a
I’m now trying to setup the pixhawk 6X using UAV Toolbox Support Package for PX4 Autopilots (ver. 24.12).
I successfully finished the hardware setup.
Next, I created a simple simulink file as below.
I connected the hardware and tried to see the measurement values, but I could not find the values.
(The displayed values are zero.)
Please tell me how to solve this problem.I’m now trying to setup the pixhawk 6X using UAV Toolbox Support Package for PX4 Autopilots (ver. 24.12).
I successfully finished the hardware setup.
Next, I created a simple simulink file as below.
I connected the hardware and tried to see the measurement values, but I could not find the values.
(The displayed values are zero.)
Please tell me how to solve this problem. I’m now trying to setup the pixhawk 6X using UAV Toolbox Support Package for PX4 Autopilots (ver. 24.12).
I successfully finished the hardware setup.
Next, I created a simple simulink file as below.
I connected the hardware and tried to see the measurement values, but I could not find the values.
(The displayed values are zero.)
Please tell me how to solve this problem. pixhawk 6x, matlab, simulink, sensor, uav toolbox support package MATLAB Answers — New Questions