Category: Matlab
Category Archives: Matlab
Can a Simulink model inherit Data Dictionary links from libraries blocks within other libraries or subsystem references?
I’m working in R2022b. I can build a library, associate a data dictionary with it, then when I use a block from the library in a model the data dictionary shows up in the Model Explorer under External Data > From Libraries. Which is awesome, because I want to associate the component-specific data with their respective libraries then never have to relink those data dictionaries as I use the library blocks throughout my model.
My issue is that as soon as I’m using a library block in a subsystem reference or another library the top-level model won’t find the data dictionary. It only finds library linked data dictionaries within the top model file. Can I make it pull in library linked data dictionaries wherever it finds them in the tree?I’m working in R2022b. I can build a library, associate a data dictionary with it, then when I use a block from the library in a model the data dictionary shows up in the Model Explorer under External Data > From Libraries. Which is awesome, because I want to associate the component-specific data with their respective libraries then never have to relink those data dictionaries as I use the library blocks throughout my model.
My issue is that as soon as I’m using a library block in a subsystem reference or another library the top-level model won’t find the data dictionary. It only finds library linked data dictionaries within the top model file. Can I make it pull in library linked data dictionaries wherever it finds them in the tree? I’m working in R2022b. I can build a library, associate a data dictionary with it, then when I use a block from the library in a model the data dictionary shows up in the Model Explorer under External Data > From Libraries. Which is awesome, because I want to associate the component-specific data with their respective libraries then never have to relink those data dictionaries as I use the library blocks throughout my model.
My issue is that as soon as I’m using a library block in a subsystem reference or another library the top-level model won’t find the data dictionary. It only finds library linked data dictionaries within the top model file. Can I make it pull in library linked data dictionaries wherever it finds them in the tree? subsystem references, data dictionaries MATLAB Answers — New Questions
Thingspeak – TCP disconnection after channel update
Hello,
When updating the channel feed the TCP connection is terminated by the Thingspeak server immediately after each request (doesn’t matter "bad" or "good").
That behavior does not depend on the method I use (reqests from ESP8266 via WiFi, GPRS, ordinary terminal program under Windows etc.)
Is that normal?
From technical point of view this is not a problem but when using GPRS the service provider charges me for 100kB of data each time the new TCP connection is open (even if seding 100 bytes) so I suspect it would be better (cheaper) to keep the connection open between the reqests.
Thank you in advance for any advice.Hello,
When updating the channel feed the TCP connection is terminated by the Thingspeak server immediately after each request (doesn’t matter "bad" or "good").
That behavior does not depend on the method I use (reqests from ESP8266 via WiFi, GPRS, ordinary terminal program under Windows etc.)
Is that normal?
From technical point of view this is not a problem but when using GPRS the service provider charges me for 100kB of data each time the new TCP connection is open (even if seding 100 bytes) so I suspect it would be better (cheaper) to keep the connection open between the reqests.
Thank you in advance for any advice. Hello,
When updating the channel feed the TCP connection is terminated by the Thingspeak server immediately after each request (doesn’t matter "bad" or "good").
That behavior does not depend on the method I use (reqests from ESP8266 via WiFi, GPRS, ordinary terminal program under Windows etc.)
Is that normal?
From technical point of view this is not a problem but when using GPRS the service provider charges me for 100kB of data each time the new TCP connection is open (even if seding 100 bytes) so I suspect it would be better (cheaper) to keep the connection open between the reqests.
Thank you in advance for any advice. tcp, disconnection MATLAB Answers — New Questions
Function ‘contains’ did not work
The background is CODY problem 95
The purpose is to confirm whether the vector s1 contains the vector s2. (or s2 cover s1)
The problem is that when the size of the vector is very large, the function ’contains‘ cannot be judged correctly.
case 1
clear
s1 = 1:100;
s2 = [50 51];
s1str=num2str(s1);
s2str=num2str(s2);
tf1=contains(s1str,s2str)
tf2=contains(s2str,s1str)
tf1 SHOULD be 1, since [50 51] is part of s1. but the result is not correct.
case 2
s1 = 40:60;
s2 = [50 51];
s1str=num2str(s1);
s2str=num2str(s2);
tf1=contains(s1str,s2str)
tf2=contains(s2str,s1str)
When the size of the vector S1 decreases, the function works normally.The background is CODY problem 95
The purpose is to confirm whether the vector s1 contains the vector s2. (or s2 cover s1)
The problem is that when the size of the vector is very large, the function ’contains‘ cannot be judged correctly.
case 1
clear
s1 = 1:100;
s2 = [50 51];
s1str=num2str(s1);
s2str=num2str(s2);
tf1=contains(s1str,s2str)
tf2=contains(s2str,s1str)
tf1 SHOULD be 1, since [50 51] is part of s1. but the result is not correct.
case 2
s1 = 40:60;
s2 = [50 51];
s1str=num2str(s1);
s2str=num2str(s2);
tf1=contains(s1str,s2str)
tf2=contains(s2str,s1str)
When the size of the vector S1 decreases, the function works normally. The background is CODY problem 95
The purpose is to confirm whether the vector s1 contains the vector s2. (or s2 cover s1)
The problem is that when the size of the vector is very large, the function ’contains‘ cannot be judged correctly.
case 1
clear
s1 = 1:100;
s2 = [50 51];
s1str=num2str(s1);
s2str=num2str(s2);
tf1=contains(s1str,s2str)
tf2=contains(s2str,s1str)
tf1 SHOULD be 1, since [50 51] is part of s1. but the result is not correct.
case 2
s1 = 40:60;
s2 = [50 51];
s1str=num2str(s1);
s2str=num2str(s2);
tf1=contains(s1str,s2str)
tf2=contains(s2str,s1str)
When the size of the vector S1 decreases, the function works normally. function, contains MATLAB Answers — New Questions
Error Installing Autosar package in 2015b matlab
I just installed a trial version of matlab 2015b and I need to add the Autosar package. I just download it and now trying to install it but I get this error from the Support package installer "Unable to load support package information. This may be duw to network problemas. Verify your network connection and retry the support package installation. If the problem persist, contact MathWorks technical support"
I check my network and I have good connection and speed. I alredy did around 20 retries but the issue persist. I noticed that other users experiences the same issue, one of them said retrying fix the problem, but that is not working for me.I just installed a trial version of matlab 2015b and I need to add the Autosar package. I just download it and now trying to install it but I get this error from the Support package installer "Unable to load support package information. This may be duw to network problemas. Verify your network connection and retry the support package installation. If the problem persist, contact MathWorks technical support"
I check my network and I have good connection and speed. I alredy did around 20 retries but the issue persist. I noticed that other users experiences the same issue, one of them said retrying fix the problem, but that is not working for me. I just installed a trial version of matlab 2015b and I need to add the Autosar package. I just download it and now trying to install it but I get this error from the Support package installer "Unable to load support package information. This may be duw to network problemas. Verify your network connection and retry the support package installation. If the problem persist, contact MathWorks technical support"
I check my network and I have good connection and speed. I alredy did around 20 retries but the issue persist. I noticed that other users experiences the same issue, one of them said retrying fix the problem, but that is not working for me. autosar, package installation MATLAB Answers — New Questions
Not getting full range of servo when running from Simulink
Hello, I have a very simple Simulink program to control a servo with my Arduino. The problem is that I’m not getting a full range of the servo. I am using an Adafruit Motor Shield to drive the servo which is a cheap TowerPro. The range I’m getting is 0 to 70. I am using Matlab/Simulink 2019.
Any ideas what could be wrong?
Thank youHello, I have a very simple Simulink program to control a servo with my Arduino. The problem is that I’m not getting a full range of the servo. I am using an Adafruit Motor Shield to drive the servo which is a cheap TowerPro. The range I’m getting is 0 to 70. I am using Matlab/Simulink 2019.
Any ideas what could be wrong?
Thank you Hello, I have a very simple Simulink program to control a servo with my Arduino. The problem is that I’m not getting a full range of the servo. I am using an Adafruit Motor Shield to drive the servo which is a cheap TowerPro. The range I’m getting is 0 to 70. I am using Matlab/Simulink 2019.
Any ideas what could be wrong?
Thank you simulink, arduino, full range, servo, adafruit MATLAB Answers — New Questions
How to get the value from a inport of a customed block with s-function and tlc concept
Hello all,
Currently I have a Simulink customed block (named as Teq block) for my own project which was built in s-function for simulation and tlc for code generation. Because of some reasons on algorithm, I have to find a way to get the value of a Simulink.Parameter(another block) via my Teq_sf.tlc file. However, my tlc file can only get the name of Simulink.Parameter instead of its value as my expectation.
I tried to define a mdlRTW function in sf.c file and call this input to tlc file via RTW, as followings:
static void mdlRTW(SimStruct *S) % in sf.c file
{
real64 *u1 = (real64 *) ssGetInputPortSignal(S, 0);
if (!ssWriteRTWParamSettings( S, 1, SSWRITE_VALUE_QSTR, "Input_Value", *u1))
{
ssSetErrorStatus(S,"Error writing parameter data to .rtw file");
return;
}
}
and %assign input_value = SFcnParamSettings.Input_Value (in tlc)
However, this way did not work because system can not understand SFcnParamSettings. Currently, this is the big blocker for my progress.
Do you know any valid solutions which I can get a value of Simulink.Parameter into my Teq_sf.tlc file but not the name?
Thank you in advance!Hello all,
Currently I have a Simulink customed block (named as Teq block) for my own project which was built in s-function for simulation and tlc for code generation. Because of some reasons on algorithm, I have to find a way to get the value of a Simulink.Parameter(another block) via my Teq_sf.tlc file. However, my tlc file can only get the name of Simulink.Parameter instead of its value as my expectation.
I tried to define a mdlRTW function in sf.c file and call this input to tlc file via RTW, as followings:
static void mdlRTW(SimStruct *S) % in sf.c file
{
real64 *u1 = (real64 *) ssGetInputPortSignal(S, 0);
if (!ssWriteRTWParamSettings( S, 1, SSWRITE_VALUE_QSTR, "Input_Value", *u1))
{
ssSetErrorStatus(S,"Error writing parameter data to .rtw file");
return;
}
}
and %assign input_value = SFcnParamSettings.Input_Value (in tlc)
However, this way did not work because system can not understand SFcnParamSettings. Currently, this is the big blocker for my progress.
Do you know any valid solutions which I can get a value of Simulink.Parameter into my Teq_sf.tlc file but not the name?
Thank you in advance! Hello all,
Currently I have a Simulink customed block (named as Teq block) for my own project which was built in s-function for simulation and tlc for code generation. Because of some reasons on algorithm, I have to find a way to get the value of a Simulink.Parameter(another block) via my Teq_sf.tlc file. However, my tlc file can only get the name of Simulink.Parameter instead of its value as my expectation.
I tried to define a mdlRTW function in sf.c file and call this input to tlc file via RTW, as followings:
static void mdlRTW(SimStruct *S) % in sf.c file
{
real64 *u1 = (real64 *) ssGetInputPortSignal(S, 0);
if (!ssWriteRTWParamSettings( S, 1, SSWRITE_VALUE_QSTR, "Input_Value", *u1))
{
ssSetErrorStatus(S,"Error writing parameter data to .rtw file");
return;
}
}
and %assign input_value = SFcnParamSettings.Input_Value (in tlc)
However, this way did not work because system can not understand SFcnParamSettings. Currently, this is the big blocker for my progress.
Do you know any valid solutions which I can get a value of Simulink.Parameter into my Teq_sf.tlc file but not the name?
Thank you in advance! matlab, simulink, s-function, tlc MATLAB Answers — New Questions
how to extract features from 350 clusters | extractEigenFeatures
Hello All,
I have around 350 clusters and I am trying to retain only matching clusters and remove unmatched ones. How to use this example in this case https://www.mathworks.com/help/lidar/ref/pcshowmatchedfeatures.htmlHello All,
I have around 350 clusters and I am trying to retain only matching clusters and remove unmatched ones. How to use this example in this case https://www.mathworks.com/help/lidar/ref/pcshowmatchedfeatures.html Hello All,
I have around 350 clusters and I am trying to retain only matching clusters and remove unmatched ones. How to use this example in this case https://www.mathworks.com/help/lidar/ref/pcshowmatchedfeatures.html lidar, cluster, eigen, featueres MATLAB Answers — New Questions
how to convert pcap to ply
Hello All,
I have velodyne lidar data in .pcap format. How to convert .pcap data into ply file?Hello All,
I have velodyne lidar data in .pcap format. How to convert .pcap data into ply file? Hello All,
I have velodyne lidar data in .pcap format. How to convert .pcap data into ply file? 3d, lidar, pointcloud, 3dobject, lidar_data MATLAB Answers — New Questions
Where is the MATLAB Connector installation log file located?
Where can I find the installation log files for the MATLAB Connector so that I may troubleshoot potential installation issues?Where can I find the installation log files for the MATLAB Connector so that I may troubleshoot potential installation issues? Where can I find the installation log files for the MATLAB Connector so that I may troubleshoot potential installation issues? MATLAB Answers — New Questions
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
SNR Calculation on the basis of channel estimation using Pilot Symbols
Hi,
I wanted to ask how can we calculate SNR on the basis of channel estimation using Pilot Symbols and make CQI table for Adaptive modulation coding according to the estiamted SNR values.
RegardsHi,
I wanted to ask how can we calculate SNR on the basis of channel estimation using Pilot Symbols and make CQI table for Adaptive modulation coding according to the estiamted SNR values.
Regards Hi,
I wanted to ask how can we calculate SNR on the basis of channel estimation using Pilot Symbols and make CQI table for Adaptive modulation coding according to the estiamted SNR values.
Regards channel estimation, snr, modulation, adaptive modulation, amc 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