Tag Archives: matlab
How to increase the speed of calculating a simple second-order equation in Simulink?
Hello! Problem with calculation speed in Simulink.
I came across a video on YouTube comparing Simulink and another program. The Simulink solver spends an unreasonable amount of time solving the example I’ve attached below. For values of the constant greater than 1e7, the integration step decreases too much. Please tell me, is it possible to somehow increase the speed of calculations?
I tried different solvers, but all attempts failed, the problem took too long to solve.
VideoHello! Problem with calculation speed in Simulink.
I came across a video on YouTube comparing Simulink and another program. The Simulink solver spends an unreasonable amount of time solving the example I’ve attached below. For values of the constant greater than 1e7, the integration step decreases too much. Please tell me, is it possible to somehow increase the speed of calculations?
I tried different solvers, but all attempts failed, the problem took too long to solve.
Video Hello! Problem with calculation speed in Simulink.
I came across a video on YouTube comparing Simulink and another program. The Simulink solver spends an unreasonable amount of time solving the example I’ve attached below. For values of the constant greater than 1e7, the integration step decreases too much. Please tell me, is it possible to somehow increase the speed of calculations?
I tried different solvers, but all attempts failed, the problem took too long to solve.
Video simulink, ode45, ode, speed, differential equations, algorithm MATLAB Answers — New Questions
Why do I get Coverage error .
Why this error, Not able to highlight because model changed error during Coverage analysis
With every model I used.Why this error, Not able to highlight because model changed error during Coverage analysis
With every model I used. Why this error, Not able to highlight because model changed error during Coverage analysis
With every model I used. coverage, modeling properties, simulink MATLAB Answers — New Questions
How to create time derivative in PDE toolbox
I am working using PDE toolbox and I need one f coefficient to be a derivative of state.u wrt time – how can I do that?I am working using PDE toolbox and I need one f coefficient to be a derivative of state.u wrt time – how can I do that? I am working using PDE toolbox and I need one f coefficient to be a derivative of state.u wrt time – how can I do that? pde toolbox pde MATLAB Answers — New Questions
How to fix the jiggly issue
I am post-processing Abaqus data on Matlab. Overall the data looks good, however, in some areas it seems to be jiggly.
I’ve looked up for the causes, but couldn’t.
Help me please.I am post-processing Abaqus data on Matlab. Overall the data looks good, however, in some areas it seems to be jiggly.
I’ve looked up for the causes, but couldn’t.
Help me please. I am post-processing Abaqus data on Matlab. Overall the data looks good, however, in some areas it seems to be jiggly.
I’ve looked up for the causes, but couldn’t.
Help me please. postprocessing MATLAB Answers — New Questions
Hierarchical clustering with similarity matrix
Hi there,
I have a similarity matrix that I would like to use as the input of the function linkage. However, this takes as an input only the a dissimilarity/distance matrix. Do you know any way by which I can manage to run a hierarchical clustering in Matlab using my similarity matrix?
Cheers!Hi there,
I have a similarity matrix that I would like to use as the input of the function linkage. However, this takes as an input only the a dissimilarity/distance matrix. Do you know any way by which I can manage to run a hierarchical clustering in Matlab using my similarity matrix?
Cheers! Hi there,
I have a similarity matrix that I would like to use as the input of the function linkage. However, this takes as an input only the a dissimilarity/distance matrix. Do you know any way by which I can manage to run a hierarchical clustering in Matlab using my similarity matrix?
Cheers! hierarchical clustering, linkage, linkage function, similarity, similarity matrix, clustering MATLAB Answers — New Questions
PID block and manual PID
Hi:
I’m having a hard time understanding the difference between the PID block and the "manual" PID. For better understanding see the enclosed image. The gains are the same for both systems (same transfer function) but for some reason the result is not the same. What could be wrong?
<</matlabcentral/answers/uploaded_files/6343/Question.png>>Hi:
I’m having a hard time understanding the difference between the PID block and the "manual" PID. For better understanding see the enclosed image. The gains are the same for both systems (same transfer function) but for some reason the result is not the same. What could be wrong?
<</matlabcentral/answers/uploaded_files/6343/Question.png>> Hi:
I’m having a hard time understanding the difference between the PID block and the "manual" PID. For better understanding see the enclosed image. The gains are the same for both systems (same transfer function) but for some reason the result is not the same. What could be wrong?
<</matlabcentral/answers/uploaded_files/6343/Question.png>> simulink, pid MATLAB Answers — New Questions
Cannot run matlab R2023a orE2023b installer on centos 7.9
Package installer does not work (it hangs indefinitely), when trying to run bin/glnxa64/MATLABWindow I get (note this also happens with version 2023a):
user@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1088}$ ./MATLABWindow
[0914/181150.225297:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.225395:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.235757:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.235800:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.236932:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.237303:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.355055:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355064:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355129:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.355132:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.421408:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.421448:INFO:client_app.cpp(484)] Not appending enable-binary-transport
./MATLABWindow: symbol lookup error: /u/local/downloads/matlab/R2023b_temp/bin/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
usr@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1089}$ [0100/000000.561825:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.Package installer does not work (it hangs indefinitely), when trying to run bin/glnxa64/MATLABWindow I get (note this also happens with version 2023a):
user@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1088}$ ./MATLABWindow
[0914/181150.225297:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.225395:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.235757:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.235800:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.236932:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.237303:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.355055:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355064:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355129:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.355132:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.421408:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.421448:INFO:client_app.cpp(484)] Not appending enable-binary-transport
./MATLABWindow: symbol lookup error: /u/local/downloads/matlab/R2023b_temp/bin/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
usr@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1089}$ [0100/000000.561825:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process. Package installer does not work (it hangs indefinitely), when trying to run bin/glnxa64/MATLABWindow I get (note this also happens with version 2023a):
user@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1088}$ ./MATLABWindow
[0914/181150.225297:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.225395:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.235757:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.235800:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.236932:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.237303:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.355055:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355064:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355129:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.355132:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.421408:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.421448:INFO:client_app.cpp(484)] Not appending enable-binary-transport
./MATLABWindow: symbol lookup error: /u/local/downloads/matlab/R2023b_temp/bin/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
usr@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1089}$ [0100/000000.561825:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process. installation, r2023a, r2023b MATLAB Answers — New Questions
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
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
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
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