Author: PuTI
How to Incorporate Explanatory Variables in State Equations Using the bnlssm Package?
Hello everyone,
I’m currently working with the bnlssm package in MATLAB to model a nonlinear state-space system. My goal is to include explanatory variables in the state equation, but I’m encountering some challenges and need your help.
Specifically, I want to modify the state equation to include external explanatory variables , such as:
In this setup:
• is the state variable.
• is an explanatory variable (could be a vector or scalar).
• represents the influence of the explanatory variable on the state dynamics.
My Questions:
1. Does the bnlssm package support incorporating explanatory variables directly into the state equation?
2. If it does, are there any specific examples or documentation that demonstrate how to achieve this?
3. If not, is there a recommended workaround for including explanatory variables, such as extending the state vector or using another approach?Hello everyone,
I’m currently working with the bnlssm package in MATLAB to model a nonlinear state-space system. My goal is to include explanatory variables in the state equation, but I’m encountering some challenges and need your help.
Specifically, I want to modify the state equation to include external explanatory variables , such as:
In this setup:
• is the state variable.
• is an explanatory variable (could be a vector or scalar).
• represents the influence of the explanatory variable on the state dynamics.
My Questions:
1. Does the bnlssm package support incorporating explanatory variables directly into the state equation?
2. If it does, are there any specific examples or documentation that demonstrate how to achieve this?
3. If not, is there a recommended workaround for including explanatory variables, such as extending the state vector or using another approach? Hello everyone,
I’m currently working with the bnlssm package in MATLAB to model a nonlinear state-space system. My goal is to include explanatory variables in the state equation, but I’m encountering some challenges and need your help.
Specifically, I want to modify the state equation to include external explanatory variables , such as:
In this setup:
• is the state variable.
• is an explanatory variable (could be a vector or scalar).
• represents the influence of the explanatory variable on the state dynamics.
My Questions:
1. Does the bnlssm package support incorporating explanatory variables directly into the state equation?
2. If it does, are there any specific examples or documentation that demonstrate how to achieve this?
3. If not, is there a recommended workaround for including explanatory variables, such as extending the state vector or using another approach? state space model, state equation, bnlssm package MATLAB Answers — New Questions
UAV simulation in lunar environment
Hello Everyone
My question is it is possible to simulate and perform communication between multiple UAV in lunar environment using MATLAB and SIMULINK. If yes, which toolbox we need to use.
Thank you in advance.Hello Everyone
My question is it is possible to simulate and perform communication between multiple UAV in lunar environment using MATLAB and SIMULINK. If yes, which toolbox we need to use.
Thank you in advance. Hello Everyone
My question is it is possible to simulate and perform communication between multiple UAV in lunar environment using MATLAB and SIMULINK. If yes, which toolbox we need to use.
Thank you in advance. uav, lunar, simulink MATLAB Answers — New Questions
Deconvolution of two different Gaussians
Hi all
I’m convolving two different Gaussians: straggling and espread. But when I deconvolve the resultant I see either straggling or "nonsense". Is it possible to deconvolve the resultant in such a way that I see espread? My code is attached.
Sorry, bit of a noob question.
Regards
TimHi all
I’m convolving two different Gaussians: straggling and espread. But when I deconvolve the resultant I see either straggling or "nonsense". Is it possible to deconvolve the resultant in such a way that I see espread? My code is attached.
Sorry, bit of a noob question.
Regards
Tim Hi all
I’m convolving two different Gaussians: straggling and espread. But when I deconvolve the resultant I see either straggling or "nonsense". Is it possible to deconvolve the resultant in such a way that I see espread? My code is attached.
Sorry, bit of a noob question.
Regards
Tim convolution MATLAB Answers — New Questions
Fletcher Reeves conjugate method
Hello,
My program is giving the right solution for the problem, but I believe it is doing unecessary steps. For a problem with initial point at [4 6], my code using conjugate method is doing more steps than when I try to solve the same problem using the steepest descent method.
-> Main function:
function [x_opt,f_opt,k] = conjugate_gradient (fob,g_fob,x0,tol_grad);
c0 = feval(g_fob,x0); % evaluate gradient at initial point
k = 0;
if norm(c0) < tol_grad
x_opt = x0; % optimum point
f_opt = feval(fob,x_opt); % cost function value
else
d0= -c0; % search direction
alfa0 = equal_interval_line_search(x0,d0,fob,0.5,1e-6); %line search (step size)
x1= x0+ alfa0*d0;
c1 = feval(g_fob,x1);
while norm(c1) > tol_grad
beta = (norm(c1)/norm(c0))^2;
d1= -c1+beta*d0;
alfa1 = equal_interval_line_search(x1,d1,fob,0.5,1e-6);
x2= x1+alfa1*d1;
c0=c1;
c1= feval(g_fob,x2);
d0=d1;
x1=x2;
k=k+1;
end
x_opt = x1;
f_opt = feval(fob,x_opt);
end
Cost function:
function f = fob_8_58(x);
f = 8*x(1)^2 + 8*x(2)^2 – 80*((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5*x(1)-5*x(2);
->Gradient fuction:
function g = grad_fob_8_58(x)
g(1) = 16*x(1) – 80*x(1)/((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*x(1)/((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5;
g(2) =16*x(2) – 80*(x(2)-10)/((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*(x(2)+10)/((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5;Hello,
My program is giving the right solution for the problem, but I believe it is doing unecessary steps. For a problem with initial point at [4 6], my code using conjugate method is doing more steps than when I try to solve the same problem using the steepest descent method.
-> Main function:
function [x_opt,f_opt,k] = conjugate_gradient (fob,g_fob,x0,tol_grad);
c0 = feval(g_fob,x0); % evaluate gradient at initial point
k = 0;
if norm(c0) < tol_grad
x_opt = x0; % optimum point
f_opt = feval(fob,x_opt); % cost function value
else
d0= -c0; % search direction
alfa0 = equal_interval_line_search(x0,d0,fob,0.5,1e-6); %line search (step size)
x1= x0+ alfa0*d0;
c1 = feval(g_fob,x1);
while norm(c1) > tol_grad
beta = (norm(c1)/norm(c0))^2;
d1= -c1+beta*d0;
alfa1 = equal_interval_line_search(x1,d1,fob,0.5,1e-6);
x2= x1+alfa1*d1;
c0=c1;
c1= feval(g_fob,x2);
d0=d1;
x1=x2;
k=k+1;
end
x_opt = x1;
f_opt = feval(fob,x_opt);
end
Cost function:
function f = fob_8_58(x);
f = 8*x(1)^2 + 8*x(2)^2 – 80*((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5*x(1)-5*x(2);
->Gradient fuction:
function g = grad_fob_8_58(x)
g(1) = 16*x(1) – 80*x(1)/((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*x(1)/((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5;
g(2) =16*x(2) – 80*(x(2)-10)/((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*(x(2)+10)/((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5; Hello,
My program is giving the right solution for the problem, but I believe it is doing unecessary steps. For a problem with initial point at [4 6], my code using conjugate method is doing more steps than when I try to solve the same problem using the steepest descent method.
-> Main function:
function [x_opt,f_opt,k] = conjugate_gradient (fob,g_fob,x0,tol_grad);
c0 = feval(g_fob,x0); % evaluate gradient at initial point
k = 0;
if norm(c0) < tol_grad
x_opt = x0; % optimum point
f_opt = feval(fob,x_opt); % cost function value
else
d0= -c0; % search direction
alfa0 = equal_interval_line_search(x0,d0,fob,0.5,1e-6); %line search (step size)
x1= x0+ alfa0*d0;
c1 = feval(g_fob,x1);
while norm(c1) > tol_grad
beta = (norm(c1)/norm(c0))^2;
d1= -c1+beta*d0;
alfa1 = equal_interval_line_search(x1,d1,fob,0.5,1e-6);
x2= x1+alfa1*d1;
c0=c1;
c1= feval(g_fob,x2);
d0=d1;
x1=x2;
k=k+1;
end
x_opt = x1;
f_opt = feval(fob,x_opt);
end
Cost function:
function f = fob_8_58(x);
f = 8*x(1)^2 + 8*x(2)^2 – 80*((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5*x(1)-5*x(2);
->Gradient fuction:
function g = grad_fob_8_58(x)
g(1) = 16*x(1) – 80*x(1)/((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*x(1)/((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5;
g(2) =16*x(2) – 80*(x(2)-10)/((x(1)^2+x(2)^2-20*x(2)+100)^0.5)- 80*(x(2)+10)/((x(1)^2+x(2)^2+20*x(2)+100)^0.5)-5; optimization, conjugate method, fletcher reeves MATLAB Answers — New Questions
What are the differences between Simscape Driveline and Simulink Powertrain Blockset?
Looking at the product pages on Mathworks’ website, Simscape Driveline and Simulink Powertrain Blockset seem be aimed at the same tasks even though, as far as I understand, the way Simscape works "under the hood" is different from Simulink systems.
What are the differences then? In which situation would I pick one over the other?Looking at the product pages on Mathworks’ website, Simscape Driveline and Simulink Powertrain Blockset seem be aimed at the same tasks even though, as far as I understand, the way Simscape works "under the hood" is different from Simulink systems.
What are the differences then? In which situation would I pick one over the other? Looking at the product pages on Mathworks’ website, Simscape Driveline and Simulink Powertrain Blockset seem be aimed at the same tasks even though, as far as I understand, the way Simscape works "under the hood" is different from Simulink systems.
What are the differences then? In which situation would I pick one over the other? simscape, simscape driveline, powertrain blockset, powertrain, simulink powertrain MATLAB Answers — New Questions
How can I use Test Manager’s results tables and format in a custom report?
I want to create a custom Simulink Test report that includes the summary and coverage tables at the end of each section as shown in the Test Manager results.
Could you advise me on how I can do this?I want to create a custom Simulink Test report that includes the summary and coverage tables at the end of each section as shown in the Test Manager results.
Could you advise me on how I can do this? I want to create a custom Simulink Test report that includes the summary and coverage tables at the end of each section as shown in the Test Manager results.
Could you advise me on how I can do this? results, coverage, report, test, manager, custom MATLAB Answers — New Questions
performance: vision.AlphaBlender is slower when image is big.
vision.AlphaBlender is a very good function that can do a lot of "image matting", but when I encounter a large image size, the speed is very slow, look forward to the official enhancement of the efficiency of this function.
blender = vision.AlphaBlender(‘Operation’,’Binary Mask’,…
‘MaskSource’,’Input port’);
% big image test performance
HH = [8000,500];
WW = [8000,500];
for i = 1:length(HH)
H = HH(i);
W = WW(i);
bottomImg = zeros(H,W,3,’single’);
topImg = rand(H,W,3,’single’);
maskImg = zeros(H,W,’logical’);
maskImg(1:100,1:100)=1;
t1 = tic;
outImg = blender(bottomImg,topImg,maskImg);
t2 = toc(t1);
fprintf(‘image size:(%d*%d) take time: %.3f secondsn’,H,W,t2)
endvision.AlphaBlender is a very good function that can do a lot of "image matting", but when I encounter a large image size, the speed is very slow, look forward to the official enhancement of the efficiency of this function.
blender = vision.AlphaBlender(‘Operation’,’Binary Mask’,…
‘MaskSource’,’Input port’);
% big image test performance
HH = [8000,500];
WW = [8000,500];
for i = 1:length(HH)
H = HH(i);
W = WW(i);
bottomImg = zeros(H,W,3,’single’);
topImg = rand(H,W,3,’single’);
maskImg = zeros(H,W,’logical’);
maskImg(1:100,1:100)=1;
t1 = tic;
outImg = blender(bottomImg,topImg,maskImg);
t2 = toc(t1);
fprintf(‘image size:(%d*%d) take time: %.3f secondsn’,H,W,t2)
end vision.AlphaBlender is a very good function that can do a lot of "image matting", but when I encounter a large image size, the speed is very slow, look forward to the official enhancement of the efficiency of this function.
blender = vision.AlphaBlender(‘Operation’,’Binary Mask’,…
‘MaskSource’,’Input port’);
% big image test performance
HH = [8000,500];
WW = [8000,500];
for i = 1:length(HH)
H = HH(i);
W = WW(i);
bottomImg = zeros(H,W,3,’single’);
topImg = rand(H,W,3,’single’);
maskImg = zeros(H,W,’logical’);
maskImg(1:100,1:100)=1;
t1 = tic;
outImg = blender(bottomImg,topImg,maskImg);
t2 = toc(t1);
fprintf(‘image size:(%d*%d) take time: %.3f secondsn’,H,W,t2)
end vision.alphablender, image processing MATLAB Answers — New Questions
How to solve this partial differential equation in simulink?
Hello , I want to simulate the following partial equation on simulink , but I dont know if what I already built is fine , I have some struggle with dc/dz ,because it gives me error when I try to build it , so I conected rate transition and discrete derivative ,but dont know it is ok . I am building a fixed bed reactor full loaded with carbon absorbed gold in which a cyanide flow is pumped into and absorbs the gold loading , depleting the carbon . Following the equations:
So i tried finite differences for dc/dz with forward difference for eactor entry , central along the reactor , and backward in the exit, and dc/dt and dq/dt use integrator blocks, I consider Co= 0 and q0=4320. The problem is that when I remove rate transition and discrete derivative in 4th reactor,gives error.
Being that said, is correct to represent dc/dz as following? :
Adjoint the simulink file down here and thanks in advance:
https://riveril123.quickconnect.to/d/s/11jhifsXc7WjjbgDgYlqicG8JX9cxHGm/1KbHfeBHUy1vF0hiTKBsPaD8Nff4HGwg-27UAduxX-QsHello , I want to simulate the following partial equation on simulink , but I dont know if what I already built is fine , I have some struggle with dc/dz ,because it gives me error when I try to build it , so I conected rate transition and discrete derivative ,but dont know it is ok . I am building a fixed bed reactor full loaded with carbon absorbed gold in which a cyanide flow is pumped into and absorbs the gold loading , depleting the carbon . Following the equations:
So i tried finite differences for dc/dz with forward difference for eactor entry , central along the reactor , and backward in the exit, and dc/dt and dq/dt use integrator blocks, I consider Co= 0 and q0=4320. The problem is that when I remove rate transition and discrete derivative in 4th reactor,gives error.
Being that said, is correct to represent dc/dz as following? :
Adjoint the simulink file down here and thanks in advance:
https://riveril123.quickconnect.to/d/s/11jhifsXc7WjjbgDgYlqicG8JX9cxHGm/1KbHfeBHUy1vF0hiTKBsPaD8Nff4HGwg-27UAduxX-Qs Hello , I want to simulate the following partial equation on simulink , but I dont know if what I already built is fine , I have some struggle with dc/dz ,because it gives me error when I try to build it , so I conected rate transition and discrete derivative ,but dont know it is ok . I am building a fixed bed reactor full loaded with carbon absorbed gold in which a cyanide flow is pumped into and absorbs the gold loading , depleting the carbon . Following the equations:
So i tried finite differences for dc/dz with forward difference for eactor entry , central along the reactor , and backward in the exit, and dc/dt and dq/dt use integrator blocks, I consider Co= 0 and q0=4320. The problem is that when I remove rate transition and discrete derivative in 4th reactor,gives error.
Being that said, is correct to represent dc/dz as following? :
Adjoint the simulink file down here and thanks in advance:
https://riveril123.quickconnect.to/d/s/11jhifsXc7WjjbgDgYlqicG8JX9cxHGm/1KbHfeBHUy1vF0hiTKBsPaD8Nff4HGwg-27UAduxX-Qs simulink, reactor, partial differential equation MATLAB Answers — New Questions
Difference between RMSE of Curve fitter and calculated RMSE in MS Excel
Dear colleagues,
I have used Curve fitter app for regression. The app calculates RMSE which is different than calculated by myself in MS Excel.
My calculation in MS Excel for RMSE is about 8 and I use the formula on the right.
I have tried to upload *.sfit file, but it is forbidden. SO I’m uploading only the excel file.Dear colleagues,
I have used Curve fitter app for regression. The app calculates RMSE which is different than calculated by myself in MS Excel.
My calculation in MS Excel for RMSE is about 8 and I use the formula on the right.
I have tried to upload *.sfit file, but it is forbidden. SO I’m uploading only the excel file. Dear colleagues,
I have used Curve fitter app for regression. The app calculates RMSE which is different than calculated by myself in MS Excel.
My calculation in MS Excel for RMSE is about 8 and I use the formula on the right.
I have tried to upload *.sfit file, but it is forbidden. SO I’m uploading only the excel file. rmse in ms excel MATLAB Answers — New Questions
PWM Generator and Boost Converter
Hi all,
I am building a PWM generator and boost converter diagram. When i vary the input (Duty Cycle) to the PWM Generator, it should control my IGBT switch that is part of my boost converter. However, i tried varying my duty cycle and the output to my boost converter remained the same.
I would appreciate if someone can help me and explain what went wrong by taking a look at the schematic attached below.
Thank you in advance!
<</matlabcentral/answers/uploaded_files/46998/Capture.PNG>>Hi all,
I am building a PWM generator and boost converter diagram. When i vary the input (Duty Cycle) to the PWM Generator, it should control my IGBT switch that is part of my boost converter. However, i tried varying my duty cycle and the output to my boost converter remained the same.
I would appreciate if someone can help me and explain what went wrong by taking a look at the schematic attached below.
Thank you in advance!
<</matlabcentral/answers/uploaded_files/46998/Capture.PNG>> Hi all,
I am building a PWM generator and boost converter diagram. When i vary the input (Duty Cycle) to the PWM Generator, it should control my IGBT switch that is part of my boost converter. However, i tried varying my duty cycle and the output to my boost converter remained the same.
I would appreciate if someone can help me and explain what went wrong by taking a look at the schematic attached below.
Thank you in advance!
<</matlabcentral/answers/uploaded_files/46998/Capture.PNG>> pwm, simulink, boost converter, power_electronics_control, electric_motor_control, power_conversion_control MATLAB Answers — New Questions
Gradient color filled bar plots.
Hello all,
I need to change the color of the barplots (attached picture below) as gradient but Matlab dos not have any function to do that, I guess. is it possible to do with patch function?Hello all,
I need to change the color of the barplots (attached picture below) as gradient but Matlab dos not have any function to do that, I guess. is it possible to do with patch function? Hello all,
I need to change the color of the barplots (attached picture below) as gradient but Matlab dos not have any function to do that, I guess. is it possible to do with patch function? barplots, gradient color MATLAB Answers — New Questions
How do I programmatically switch to Dark Mode (Dark Theme) in R2025a?
I am running R2025a pre-release. What are the commands to switch to dark mode?I am running R2025a pre-release. What are the commands to switch to dark mode? I am running R2025a pre-release. What are the commands to switch to dark mode? dark mode MATLAB Answers — New Questions
2nd Order Low-Pass Sallen Key and Multi Feedback Filter Design (Chebyshev)
I am trying to understand how to design a Sallen Key and MFB Filter that has Chebyshev characterisitcs.
Currently I am inputting the T.F (shown below) into MATLAB and using bode command to plot the T.F of various Qs to analyse the difference.
H.wo^2/S^2+(wo/Q)+wo^2
H=3.16, wo=125663, Q=varied to anaylse difference (intervals between 0.5 to 10)
When trying to utilise cheby1 and cheby2 to get the filters characteristics I am getting confused.
I input the relevant info into cheby1 below
[b,a] = cheby1(n,Rp,Wp,fType)
n=2, Rp=0.5, Wp=20000Hz, "low"
I keep getting this error "the cutoff frequencies must be within the interval of (0 1)".
I am very new to matlab and filter designs but I am struggling to understand what I am missing
Thanks,
AndyI am trying to understand how to design a Sallen Key and MFB Filter that has Chebyshev characterisitcs.
Currently I am inputting the T.F (shown below) into MATLAB and using bode command to plot the T.F of various Qs to analyse the difference.
H.wo^2/S^2+(wo/Q)+wo^2
H=3.16, wo=125663, Q=varied to anaylse difference (intervals between 0.5 to 10)
When trying to utilise cheby1 and cheby2 to get the filters characteristics I am getting confused.
I input the relevant info into cheby1 below
[b,a] = cheby1(n,Rp,Wp,fType)
n=2, Rp=0.5, Wp=20000Hz, "low"
I keep getting this error "the cutoff frequencies must be within the interval of (0 1)".
I am very new to matlab and filter designs but I am struggling to understand what I am missing
Thanks,
Andy I am trying to understand how to design a Sallen Key and MFB Filter that has Chebyshev characterisitcs.
Currently I am inputting the T.F (shown below) into MATLAB and using bode command to plot the T.F of various Qs to analyse the difference.
H.wo^2/S^2+(wo/Q)+wo^2
H=3.16, wo=125663, Q=varied to anaylse difference (intervals between 0.5 to 10)
When trying to utilise cheby1 and cheby2 to get the filters characteristics I am getting confused.
I input the relevant info into cheby1 below
[b,a] = cheby1(n,Rp,Wp,fType)
n=2, Rp=0.5, Wp=20000Hz, "low"
I keep getting this error "the cutoff frequencies must be within the interval of (0 1)".
I am very new to matlab and filter designs but I am struggling to understand what I am missing
Thanks,
Andy 2nd order filters, matlab code, sallen key, mfb, chebyshev MATLAB Answers — New Questions
Why am I prompted for admin credentials every time I launch MATLAB on Windows?
Why am I prompted to enter admin credentials every time I run MATLAB on Windows?Why am I prompted to enter admin credentials every time I run MATLAB on Windows? Why am I prompted to enter admin credentials every time I run MATLAB on Windows? MATLAB Answers — New Questions
CustomDisplay functionality for AppDesigner apps
I’m developing an AppDesigner App that I intend to interact with from the console. Right now, when I display my app at the console, my custom members get buried under all the public handles as shown below:
>> hApp
hApp =
MyApp with properties:
UIFigure: [1×1 Figure]
FileMenu: [1×1 Menu]
OpenMenu: [1×1 Menu]
SaveMenu: [1×1 Menu]
… % Many more handles omitted for brevity % …
foo: 0
bar: [1×1 struct]
baz: [1×1 struct]
I’m trying to achieve something similar to this, where the least useful public members are hidden in the properties link:
>> hApp.UIFigure
ans =
Figure (MyApp) with properties:
Number: []
Name: ‘MyApp’
Color: [940.0000e-003 940.0000e-003 940.0000e-003]
Position: [2.1360e+003 -663.0000e+000 640.0000e+000 480.0000e+000]
Units: ‘pixels’
Show all properties
The Figure class can easily achieve this due to inheritance from matlab.mixin.CustomDisplay. However, AFAIK, it is not possible to edit the inheritance of AppDesigner apps.
How do I hide visibility of particular members without reinventing the wheel?I’m developing an AppDesigner App that I intend to interact with from the console. Right now, when I display my app at the console, my custom members get buried under all the public handles as shown below:
>> hApp
hApp =
MyApp with properties:
UIFigure: [1×1 Figure]
FileMenu: [1×1 Menu]
OpenMenu: [1×1 Menu]
SaveMenu: [1×1 Menu]
… % Many more handles omitted for brevity % …
foo: 0
bar: [1×1 struct]
baz: [1×1 struct]
I’m trying to achieve something similar to this, where the least useful public members are hidden in the properties link:
>> hApp.UIFigure
ans =
Figure (MyApp) with properties:
Number: []
Name: ‘MyApp’
Color: [940.0000e-003 940.0000e-003 940.0000e-003]
Position: [2.1360e+003 -663.0000e+000 640.0000e+000 480.0000e+000]
Units: ‘pixels’
Show all properties
The Figure class can easily achieve this due to inheritance from matlab.mixin.CustomDisplay. However, AFAIK, it is not possible to edit the inheritance of AppDesigner apps.
How do I hide visibility of particular members without reinventing the wheel? I’m developing an AppDesigner App that I intend to interact with from the console. Right now, when I display my app at the console, my custom members get buried under all the public handles as shown below:
>> hApp
hApp =
MyApp with properties:
UIFigure: [1×1 Figure]
FileMenu: [1×1 Menu]
OpenMenu: [1×1 Menu]
SaveMenu: [1×1 Menu]
… % Many more handles omitted for brevity % …
foo: 0
bar: [1×1 struct]
baz: [1×1 struct]
I’m trying to achieve something similar to this, where the least useful public members are hidden in the properties link:
>> hApp.UIFigure
ans =
Figure (MyApp) with properties:
Number: []
Name: ‘MyApp’
Color: [940.0000e-003 940.0000e-003 940.0000e-003]
Position: [2.1360e+003 -663.0000e+000 640.0000e+000 480.0000e+000]
Units: ‘pixels’
Show all properties
The Figure class can easily achieve this due to inheritance from matlab.mixin.CustomDisplay. However, AFAIK, it is not possible to edit the inheritance of AppDesigner apps.
How do I hide visibility of particular members without reinventing the wheel? appdesigner, customdisplay MATLAB Answers — New Questions
How to debug and resolve SIL/MIL discrepancies when using AUTOSAR Code Replacement Library (CRL)?
I am utilizing the AUTOSAR Code Replacement Library (CRL) and have observed discrepancies between the simulation results and the Software-in-the-Loop (SIL) outcomes. What could be the root causes of these issues, and how can I implement effective workarounds?I am utilizing the AUTOSAR Code Replacement Library (CRL) and have observed discrepancies between the simulation results and the Software-in-the-Loop (SIL) outcomes. What could be the root causes of these issues, and how can I implement effective workarounds? I am utilizing the AUTOSAR Code Replacement Library (CRL) and have observed discrepancies between the simulation results and the Software-in-the-Loop (SIL) outcomes. What could be the root causes of these issues, and how can I implement effective workarounds? MATLAB Answers — New Questions
I have some issues with derivating D-Q inductance from a five-phase FEA data.
Hi folks,
I have simulated a five-phase interior PMSM on FEA software to get self and mutual inductance data. The data have been calculated according to mechanical rotor angle (half of the electrical angle in my case). Now, I want to calculate d and q inductances. As you know, there is a five-phase coordinate transformation block in Simulink and one can easily get the equations from the block help page. The equation is given below. However, when I calculate the d-q inductances by electrical rotor angle the results are not constant. The results formed a sinusoidal wave shape. Is there anyone familiar with such calculations to help me figure it out?
Thanks for your help in advance!
The code:
a=length(e_deg);
Ld=zeros(a,1);
Lq=zeros(a,1);
for ind=1:a
Ld(ind,1)=(2/5)*(sind(e_deg(ind,1))*Laa(ind,1)+sind(e_deg(ind,1)-72)*Lbb(ind,1)+sind(e_deg(ind,1)-144)*Lcc(ind,1)+sind(e_deg(ind,1)+144)*Ldd(ind,1)+sind(e_deg(ind,1)+72)*Lee(ind,1));
Lq(ind,1)=(2/5)*(cosd(e_deg(ind,1))*Laa(ind,1)+cosd(e_deg(ind,1)-72)*Lbb(ind,1)+cosd(e_deg(ind,1)-144)*Lcc(ind,1)+cosd(e_deg(ind,1)+144)*Ldd(ind,1)+cosd(e_deg(ind,1)+72)*Lee(ind,1));
end
figure
plot(e_deg,Ld)
hold on
plot(e_deg,Lq)
legend(‘Ld’,’Lq’)
The transformation matrix I have used: Implement abcde to dqxy0 transform – Simulink (mathworks.com)
The results i got:Hi folks,
I have simulated a five-phase interior PMSM on FEA software to get self and mutual inductance data. The data have been calculated according to mechanical rotor angle (half of the electrical angle in my case). Now, I want to calculate d and q inductances. As you know, there is a five-phase coordinate transformation block in Simulink and one can easily get the equations from the block help page. The equation is given below. However, when I calculate the d-q inductances by electrical rotor angle the results are not constant. The results formed a sinusoidal wave shape. Is there anyone familiar with such calculations to help me figure it out?
Thanks for your help in advance!
The code:
a=length(e_deg);
Ld=zeros(a,1);
Lq=zeros(a,1);
for ind=1:a
Ld(ind,1)=(2/5)*(sind(e_deg(ind,1))*Laa(ind,1)+sind(e_deg(ind,1)-72)*Lbb(ind,1)+sind(e_deg(ind,1)-144)*Lcc(ind,1)+sind(e_deg(ind,1)+144)*Ldd(ind,1)+sind(e_deg(ind,1)+72)*Lee(ind,1));
Lq(ind,1)=(2/5)*(cosd(e_deg(ind,1))*Laa(ind,1)+cosd(e_deg(ind,1)-72)*Lbb(ind,1)+cosd(e_deg(ind,1)-144)*Lcc(ind,1)+cosd(e_deg(ind,1)+144)*Ldd(ind,1)+cosd(e_deg(ind,1)+72)*Lee(ind,1));
end
figure
plot(e_deg,Ld)
hold on
plot(e_deg,Lq)
legend(‘Ld’,’Lq’)
The transformation matrix I have used: Implement abcde to dqxy0 transform – Simulink (mathworks.com)
The results i got: Hi folks,
I have simulated a five-phase interior PMSM on FEA software to get self and mutual inductance data. The data have been calculated according to mechanical rotor angle (half of the electrical angle in my case). Now, I want to calculate d and q inductances. As you know, there is a five-phase coordinate transformation block in Simulink and one can easily get the equations from the block help page. The equation is given below. However, when I calculate the d-q inductances by electrical rotor angle the results are not constant. The results formed a sinusoidal wave shape. Is there anyone familiar with such calculations to help me figure it out?
Thanks for your help in advance!
The code:
a=length(e_deg);
Ld=zeros(a,1);
Lq=zeros(a,1);
for ind=1:a
Ld(ind,1)=(2/5)*(sind(e_deg(ind,1))*Laa(ind,1)+sind(e_deg(ind,1)-72)*Lbb(ind,1)+sind(e_deg(ind,1)-144)*Lcc(ind,1)+sind(e_deg(ind,1)+144)*Ldd(ind,1)+sind(e_deg(ind,1)+72)*Lee(ind,1));
Lq(ind,1)=(2/5)*(cosd(e_deg(ind,1))*Laa(ind,1)+cosd(e_deg(ind,1)-72)*Lbb(ind,1)+cosd(e_deg(ind,1)-144)*Lcc(ind,1)+cosd(e_deg(ind,1)+144)*Ldd(ind,1)+cosd(e_deg(ind,1)+72)*Lee(ind,1));
end
figure
plot(e_deg,Ld)
hold on
plot(e_deg,Lq)
legend(‘Ld’,’Lq’)
The transformation matrix I have used: Implement abcde to dqxy0 transform – Simulink (mathworks.com)
The results i got: matlab, coordinate transformation, park transformation MATLAB Answers — New Questions
handle character minus character
I have two characters which contain ’18:29:42.835′ and ’18:29:49.425′. How is it possible to subtrack t2-t1 so as to find duration?I have two characters which contain ’18:29:42.835′ and ’18:29:49.425′. How is it possible to subtrack t2-t1 so as to find duration? I have two characters which contain ’18:29:42.835′ and ’18:29:49.425′. How is it possible to subtrack t2-t1 so as to find duration? characters, comma, separated, list MATLAB Answers — New Questions
flickering lamp with visual effects in simulink
Hi,
I’m trying to simulate a lamp connected to an electrical system that suffers from flickering voltage in simulink. The lamp light should show flicker in a visual manner. Any idea’s if this is possible or how to go about it?
Please, assume here that lamp is a resistor therefore when the voltage changes the energy flowing in changes as and a result the light loses or gains intensity. So a simple way to regulate the intensity of a monocolored lamp in simulink should do nicely.
If you have more knowledge regarding this topic please answer the following question as well.
In a broader sense is there a way for example to simulate a tungsten filament lighting up or any other phenomenon, assuming you have the equations governing it (supposing you can solve it with finite element or what have you), with visual effects?
Cordially,
OmidHi,
I’m trying to simulate a lamp connected to an electrical system that suffers from flickering voltage in simulink. The lamp light should show flicker in a visual manner. Any idea’s if this is possible or how to go about it?
Please, assume here that lamp is a resistor therefore when the voltage changes the energy flowing in changes as and a result the light loses or gains intensity. So a simple way to regulate the intensity of a monocolored lamp in simulink should do nicely.
If you have more knowledge regarding this topic please answer the following question as well.
In a broader sense is there a way for example to simulate a tungsten filament lighting up or any other phenomenon, assuming you have the equations governing it (supposing you can solve it with finite element or what have you), with visual effects?
Cordially,
Omid Hi,
I’m trying to simulate a lamp connected to an electrical system that suffers from flickering voltage in simulink. The lamp light should show flicker in a visual manner. Any idea’s if this is possible or how to go about it?
Please, assume here that lamp is a resistor therefore when the voltage changes the energy flowing in changes as and a result the light loses or gains intensity. So a simple way to regulate the intensity of a monocolored lamp in simulink should do nicely.
If you have more knowledge regarding this topic please answer the following question as well.
In a broader sense is there a way for example to simulate a tungsten filament lighting up or any other phenomenon, assuming you have the equations governing it (supposing you can solve it with finite element or what have you), with visual effects?
Cordially,
Omid simulink, visual effects, flicker, lamp MATLAB Answers — New Questions
Pole pair on Single Phase Asynchronous motor Cap Start-Run
Hi,
I am getting an error while trying to simulate a Single phase Asynchronous motor. When I change the pole pair from 2 which is the default to 1 I am getting negative rpm. When the pole pair is 2 or 3 or 4 it works fine with the correct speed and positive rpm.
This is the block of AC Cap-Start/Run motor:
Best regards,
Andrew.Hi,
I am getting an error while trying to simulate a Single phase Asynchronous motor. When I change the pole pair from 2 which is the default to 1 I am getting negative rpm. When the pole pair is 2 or 3 or 4 it works fine with the correct speed and positive rpm.
This is the block of AC Cap-Start/Run motor:
Best regards,
Andrew. Hi,
I am getting an error while trying to simulate a Single phase Asynchronous motor. When I change the pole pair from 2 which is the default to 1 I am getting negative rpm. When the pole pair is 2 or 3 or 4 it works fine with the correct speed and positive rpm.
This is the block of AC Cap-Start/Run motor:
Best regards,
Andrew. single phase asynchronous motor, cap-start MATLAB Answers — New Questions