Tag Archives: matlab
Error when checking data points in plot
I have been running into this issue for some time. I can not hover my mouse over a plot and have the time-value information displayed. I am using ‘plot’ function to display the figure.
I get this warning in the command window:
Error in matlab.graphics.interaction.actions.Linger
Warning: Error occurred while executing the listener callback for event WindowMouseMotion defined for class matlab.ui.Figure:
Undefined function ‘convertDataToPickSpace’ for input arguments of type ‘matlab.graphics.chart.primitive.Line’.
Error in matlab.graphics.chart.interaction.dataannotatable.picking.AnnotatablePicker/convertToPickSpace (line 40)
pickLocations = convertDataToPickSpace(hContext, iter, request3D);
Error in matlab.graphics.chart.interaction.dataannotatable.picking.AnnotatablePicker/nearestSegment (line 39)
pixelLocations = obj.convertToPickSpace(hContext, varargin, valid);
Error in matlab.graphics.chart.interaction.dataannotatable.LineHelper>localGetNearestSegment (line 252)
[index1, index2, t] = utils.nearestSegment(hLine, position, isPixelPoint, data{:});
Error in matlab.graphics.chart.interaction.dataannotatable.LineHelper.getNearestPoint (line 77)
[index1, index2, t] = localGetNearestSegment(hLine, position, true);
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.actions.Linger
Warning says I have a missing function ‘convertDataToPickSpace’.
Am I missing a toolbox?
I am using MATLAB R2022b, but have the same issue in R2024b.
Thanks in advance!I have been running into this issue for some time. I can not hover my mouse over a plot and have the time-value information displayed. I am using ‘plot’ function to display the figure.
I get this warning in the command window:
Error in matlab.graphics.interaction.actions.Linger
Warning: Error occurred while executing the listener callback for event WindowMouseMotion defined for class matlab.ui.Figure:
Undefined function ‘convertDataToPickSpace’ for input arguments of type ‘matlab.graphics.chart.primitive.Line’.
Error in matlab.graphics.chart.interaction.dataannotatable.picking.AnnotatablePicker/convertToPickSpace (line 40)
pickLocations = convertDataToPickSpace(hContext, iter, request3D);
Error in matlab.graphics.chart.interaction.dataannotatable.picking.AnnotatablePicker/nearestSegment (line 39)
pixelLocations = obj.convertToPickSpace(hContext, varargin, valid);
Error in matlab.graphics.chart.interaction.dataannotatable.LineHelper>localGetNearestSegment (line 252)
[index1, index2, t] = utils.nearestSegment(hLine, position, isPixelPoint, data{:});
Error in matlab.graphics.chart.interaction.dataannotatable.LineHelper.getNearestPoint (line 77)
[index1, index2, t] = localGetNearestSegment(hLine, position, true);
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.actions.Linger
Warning says I have a missing function ‘convertDataToPickSpace’.
Am I missing a toolbox?
I am using MATLAB R2022b, but have the same issue in R2024b.
Thanks in advance! I have been running into this issue for some time. I can not hover my mouse over a plot and have the time-value information displayed. I am using ‘plot’ function to display the figure.
I get this warning in the command window:
Error in matlab.graphics.interaction.actions.Linger
Warning: Error occurred while executing the listener callback for event WindowMouseMotion defined for class matlab.ui.Figure:
Undefined function ‘convertDataToPickSpace’ for input arguments of type ‘matlab.graphics.chart.primitive.Line’.
Error in matlab.graphics.chart.interaction.dataannotatable.picking.AnnotatablePicker/convertToPickSpace (line 40)
pickLocations = convertDataToPickSpace(hContext, iter, request3D);
Error in matlab.graphics.chart.interaction.dataannotatable.picking.AnnotatablePicker/nearestSegment (line 39)
pixelLocations = obj.convertToPickSpace(hContext, varargin, valid);
Error in matlab.graphics.chart.interaction.dataannotatable.LineHelper>localGetNearestSegment (line 252)
[index1, index2, t] = utils.nearestSegment(hLine, position, isPixelPoint, data{:});
Error in matlab.graphics.chart.interaction.dataannotatable.LineHelper.getNearestPoint (line 77)
[index1, index2, t] = localGetNearestSegment(hLine, position, true);
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.actions.Linger
Warning says I have a missing function ‘convertDataToPickSpace’.
Am I missing a toolbox?
I am using MATLAB R2022b, but have the same issue in R2024b.
Thanks in advance! plot MATLAB Answers — New Questions
Semi-truck diesel engine modelling with Generic Engine
I used tabulated torque data, and the engine cannot seem to function normally. Trying to model the torque-rpm curve of the engine in the included PDF. Also looked at lookup tables, but with less success. Any ideas how could i replicate the curve with the most realism? Or whats actually wrong with my generic engine block? The linked system is just for trying out, and making the engine itself work. It will be part of a bigger multibody system eventually. Thanks for the help!I used tabulated torque data, and the engine cannot seem to function normally. Trying to model the torque-rpm curve of the engine in the included PDF. Also looked at lookup tables, but with less success. Any ideas how could i replicate the curve with the most realism? Or whats actually wrong with my generic engine block? The linked system is just for trying out, and making the engine itself work. It will be part of a bigger multibody system eventually. Thanks for the help! I used tabulated torque data, and the engine cannot seem to function normally. Trying to model the torque-rpm curve of the engine in the included PDF. Also looked at lookup tables, but with less success. Any ideas how could i replicate the curve with the most realism? Or whats actually wrong with my generic engine block? The linked system is just for trying out, and making the engine itself work. It will be part of a bigger multibody system eventually. Thanks for the help! generic engine MATLAB Answers — New Questions
Six-Phase PMSM FEA Block Working as Motor
Hello,
I work on dual three-phase PMSM simulation. Now, I have exported flux linkage LUTs as function of current and angle from Ansys Maxwell, and loaded them to my MATLAB workspace.
I would like to take benefit from this ready Mathworks example, which connects Motor-CAD data of 6-phase machine to Simscape simulation with the help of a customized Simscape block: https://www.mathworks.com/help/sps/ug/import-fem-motorcad-six_phase.html
But the problem is, that this customized block is implemented as a generator in this example! Can I still use it directly as a motor, just by applying voltages as input and reading mechanical quantities on outputs (i.e. by cchanging the energy flow)?? Or should I make changes on the core equations inside the block?? Maybe people who developed this example can answer me in the best way possible.
I appreciate any effort to help.
Thank you in advance,
Ali BashabshehHello,
I work on dual three-phase PMSM simulation. Now, I have exported flux linkage LUTs as function of current and angle from Ansys Maxwell, and loaded them to my MATLAB workspace.
I would like to take benefit from this ready Mathworks example, which connects Motor-CAD data of 6-phase machine to Simscape simulation with the help of a customized Simscape block: https://www.mathworks.com/help/sps/ug/import-fem-motorcad-six_phase.html
But the problem is, that this customized block is implemented as a generator in this example! Can I still use it directly as a motor, just by applying voltages as input and reading mechanical quantities on outputs (i.e. by cchanging the energy flow)?? Or should I make changes on the core equations inside the block?? Maybe people who developed this example can answer me in the best way possible.
I appreciate any effort to help.
Thank you in advance,
Ali Bashabsheh Hello,
I work on dual three-phase PMSM simulation. Now, I have exported flux linkage LUTs as function of current and angle from Ansys Maxwell, and loaded them to my MATLAB workspace.
I would like to take benefit from this ready Mathworks example, which connects Motor-CAD data of 6-phase machine to Simscape simulation with the help of a customized Simscape block: https://www.mathworks.com/help/sps/ug/import-fem-motorcad-six_phase.html
But the problem is, that this customized block is implemented as a generator in this example! Can I still use it directly as a motor, just by applying voltages as input and reading mechanical quantities on outputs (i.e. by cchanging the energy flow)?? Or should I make changes on the core equations inside the block?? Maybe people who developed this example can answer me in the best way possible.
I appreciate any effort to help.
Thank you in advance,
Ali Bashabsheh six-phase pmsm, fem-parametrized MATLAB Answers — New Questions
Is it possible to generate C code with Embedded Coder (ERT TLC) following the Google C style guide?
Hello,
I am using Embedded Coder with the ERT TLC file to generate C code from Simulink models.
I would like to know if it is possible to configure the code generator so that the generated functions and source files comply with the Google C Style Guide.
In particular, I am interested in:
Function naming conventions
Indentation and formatting rules
File structure and organization
Is there any built-in support for this, or would it require customizing TLC files and code generation templates?
Any references or examples would be very helpful.
Thank you in advance!Hello,
I am using Embedded Coder with the ERT TLC file to generate C code from Simulink models.
I would like to know if it is possible to configure the code generator so that the generated functions and source files comply with the Google C Style Guide.
In particular, I am interested in:
Function naming conventions
Indentation and formatting rules
File structure and organization
Is there any built-in support for this, or would it require customizing TLC files and code generation templates?
Any references or examples would be very helpful.
Thank you in advance! Hello,
I am using Embedded Coder with the ERT TLC file to generate C code from Simulink models.
I would like to know if it is possible to configure the code generator so that the generated functions and source files comply with the Google C Style Guide.
In particular, I am interested in:
Function naming conventions
Indentation and formatting rules
File structure and organization
Is there any built-in support for this, or would it require customizing TLC files and code generation templates?
Any references or examples would be very helpful.
Thank you in advance! embedded coder, google style, standard MATLAB Answers — New Questions
Implement data type propagation for custom block
After some discussion and playing around, I got some ways in defining a block mask that sets the Simulink (fixed point) data type of an output. i have a mask parameter called "quotype" that is a Data Type parameter, and I can pass a related parameter into my MATLAB Function block that has that data type which can then be acted upon. However, I’d like to support rules such as "Inherit: Inherit via internal rule" and "Inherit: Inherit via back propagation". To do so, I need to be able to retrieve information on the signals/ports as they’re compiling in Mask call back function. To wit: I have the current code that for instance works correctly when a specific data type is invoked:
% Initialization code section
function initialization()
if ~isa(quotype,’Simulink.NumericType’)
ports = get_param(gcb,"PortHandles");
out1 = ports.Outport(1);
in1 = ports.Inport(1);
in2 = ports.Inport(2);
disp(ports)
switch quotype
case ‘Inherit: Inherit via internal rule’
ttmp = fixdt(0,10,2);
case ‘Inherit: Inherit via back propagation’
ttmp = fixdt(0,10,2);
case ‘Inherit: Same as first input’
ttmp = fixdt(0,10,2);
otherwise
disp(quotype)
ttmp = fixdt(0,10,2);
end
qtype = fi(0,ttmp);
else
qtype = fi(0,quotype);
end
end
So, if a specific numeric type is provided in the dialog, I see I get a Simulink.NumericType object and life is good. If one of the other rules is selected, I get a string. As you can see, I can access stuff like the block port handles, but they’re doubles not objects so I have no idea what to do next. I can’t run this in the debugger apparently so I’m limited to my disp() statements that put stuff in the Diagnostic Viewer. The qtype is passed as a parameter into the underlying MATLAB function and the numeric type can be re-fetched by the call fixed.extractNumericType().
Help!After some discussion and playing around, I got some ways in defining a block mask that sets the Simulink (fixed point) data type of an output. i have a mask parameter called "quotype" that is a Data Type parameter, and I can pass a related parameter into my MATLAB Function block that has that data type which can then be acted upon. However, I’d like to support rules such as "Inherit: Inherit via internal rule" and "Inherit: Inherit via back propagation". To do so, I need to be able to retrieve information on the signals/ports as they’re compiling in Mask call back function. To wit: I have the current code that for instance works correctly when a specific data type is invoked:
% Initialization code section
function initialization()
if ~isa(quotype,’Simulink.NumericType’)
ports = get_param(gcb,"PortHandles");
out1 = ports.Outport(1);
in1 = ports.Inport(1);
in2 = ports.Inport(2);
disp(ports)
switch quotype
case ‘Inherit: Inherit via internal rule’
ttmp = fixdt(0,10,2);
case ‘Inherit: Inherit via back propagation’
ttmp = fixdt(0,10,2);
case ‘Inherit: Same as first input’
ttmp = fixdt(0,10,2);
otherwise
disp(quotype)
ttmp = fixdt(0,10,2);
end
qtype = fi(0,ttmp);
else
qtype = fi(0,quotype);
end
end
So, if a specific numeric type is provided in the dialog, I see I get a Simulink.NumericType object and life is good. If one of the other rules is selected, I get a string. As you can see, I can access stuff like the block port handles, but they’re doubles not objects so I have no idea what to do next. I can’t run this in the debugger apparently so I’m limited to my disp() statements that put stuff in the Diagnostic Viewer. The qtype is passed as a parameter into the underlying MATLAB function and the numeric type can be re-fetched by the call fixed.extractNumericType().
Help! After some discussion and playing around, I got some ways in defining a block mask that sets the Simulink (fixed point) data type of an output. i have a mask parameter called "quotype" that is a Data Type parameter, and I can pass a related parameter into my MATLAB Function block that has that data type which can then be acted upon. However, I’d like to support rules such as "Inherit: Inherit via internal rule" and "Inherit: Inherit via back propagation". To do so, I need to be able to retrieve information on the signals/ports as they’re compiling in Mask call back function. To wit: I have the current code that for instance works correctly when a specific data type is invoked:
% Initialization code section
function initialization()
if ~isa(quotype,’Simulink.NumericType’)
ports = get_param(gcb,"PortHandles");
out1 = ports.Outport(1);
in1 = ports.Inport(1);
in2 = ports.Inport(2);
disp(ports)
switch quotype
case ‘Inherit: Inherit via internal rule’
ttmp = fixdt(0,10,2);
case ‘Inherit: Inherit via back propagation’
ttmp = fixdt(0,10,2);
case ‘Inherit: Same as first input’
ttmp = fixdt(0,10,2);
otherwise
disp(quotype)
ttmp = fixdt(0,10,2);
end
qtype = fi(0,ttmp);
else
qtype = fi(0,quotype);
end
end
So, if a specific numeric type is provided in the dialog, I see I get a Simulink.NumericType object and life is good. If one of the other rules is selected, I get a string. As you can see, I can access stuff like the block port handles, but they’re doubles not objects so I have no idea what to do next. I can’t run this in the debugger apparently so I’m limited to my disp() statements that put stuff in the Diagnostic Viewer. The qtype is passed as a parameter into the underlying MATLAB function and the numeric type can be re-fetched by the call fixed.extractNumericType().
Help! mask parameters, port signals MATLAB Answers — New Questions
Matlab calculations randomly take forever to run, not represented in tic toc
Hello all, I have a weird issue I was wondering if someone might have some idea on how to fix. I’m running Matlab 2024b on a Dell XPS 14 laptop. My issue is that seemingly randomly (perhaps 1 out every 6-10 operations) Matlab takes forever to run selected lines of code (or anything at all). For instance, I just ran this line of code:
tic
ECR_PBO_Support_1 = [];
ECR_PBO_Support_2 = [norm_2_32_PBO_Support01.ECR, norm_2_32_PBO_Support02.ECR, norm_2_32_PBO_Support03.ECR, norm_2_32_PBO_Support04.ECR, norm_2_32_PBO_Support05.ECR,…
norm_2_32_PBO_Support06.ECR, norm_2_32_PBO_Support07.ECR, norm_2_32_PBO_Support08.ECR];
ECR_PBO_Support_Total = [ECR_PBO_Support_1,ECR_PBO_Support_2];
toc
What the data is is irrelevant (its ultimately 8 vectors of 100 numbers long). But when I ran these lines, Matlab took about 5-8 seconds to run (i.e. it displays ‘Busy". Even though the output of tic toc was:
Elapsed time is 0.015314 seconds.
For the life of me, I cannot figure out why Matlab is doing this, but its causing me to really slow down since even the most basic operations will randomly take 5-8 seconds to run. When it happens, the delay affects everything, calculations, plots etc.
Has anyone experienced this before or have any suggestions for settings to check?Hello all, I have a weird issue I was wondering if someone might have some idea on how to fix. I’m running Matlab 2024b on a Dell XPS 14 laptop. My issue is that seemingly randomly (perhaps 1 out every 6-10 operations) Matlab takes forever to run selected lines of code (or anything at all). For instance, I just ran this line of code:
tic
ECR_PBO_Support_1 = [];
ECR_PBO_Support_2 = [norm_2_32_PBO_Support01.ECR, norm_2_32_PBO_Support02.ECR, norm_2_32_PBO_Support03.ECR, norm_2_32_PBO_Support04.ECR, norm_2_32_PBO_Support05.ECR,…
norm_2_32_PBO_Support06.ECR, norm_2_32_PBO_Support07.ECR, norm_2_32_PBO_Support08.ECR];
ECR_PBO_Support_Total = [ECR_PBO_Support_1,ECR_PBO_Support_2];
toc
What the data is is irrelevant (its ultimately 8 vectors of 100 numbers long). But when I ran these lines, Matlab took about 5-8 seconds to run (i.e. it displays ‘Busy". Even though the output of tic toc was:
Elapsed time is 0.015314 seconds.
For the life of me, I cannot figure out why Matlab is doing this, but its causing me to really slow down since even the most basic operations will randomly take 5-8 seconds to run. When it happens, the delay affects everything, calculations, plots etc.
Has anyone experienced this before or have any suggestions for settings to check? Hello all, I have a weird issue I was wondering if someone might have some idea on how to fix. I’m running Matlab 2024b on a Dell XPS 14 laptop. My issue is that seemingly randomly (perhaps 1 out every 6-10 operations) Matlab takes forever to run selected lines of code (or anything at all). For instance, I just ran this line of code:
tic
ECR_PBO_Support_1 = [];
ECR_PBO_Support_2 = [norm_2_32_PBO_Support01.ECR, norm_2_32_PBO_Support02.ECR, norm_2_32_PBO_Support03.ECR, norm_2_32_PBO_Support04.ECR, norm_2_32_PBO_Support05.ECR,…
norm_2_32_PBO_Support06.ECR, norm_2_32_PBO_Support07.ECR, norm_2_32_PBO_Support08.ECR];
ECR_PBO_Support_Total = [ECR_PBO_Support_1,ECR_PBO_Support_2];
toc
What the data is is irrelevant (its ultimately 8 vectors of 100 numbers long). But when I ran these lines, Matlab took about 5-8 seconds to run (i.e. it displays ‘Busy". Even though the output of tic toc was:
Elapsed time is 0.015314 seconds.
For the life of me, I cannot figure out why Matlab is doing this, but its causing me to really slow down since even the most basic operations will randomly take 5-8 seconds to run. When it happens, the delay affects everything, calculations, plots etc.
Has anyone experienced this before or have any suggestions for settings to check? processing time, matlab, script, speed, optimization MATLAB Answers — New Questions
Distinguish installed MATLAB from Online/Mobile versions
MATLAB has commands such as ispc/ismac/isunix and computer to determine the local computing environment. Is there a way to distinguish MATLAB Online and MATLAB Mobile from a local install? Both the online and mobile versions report themselves as 64-bit Linux, which is presumably the Mathworks server running behind the scenes. Both also have an enviroment variable MW_DDUX_APP_NAME that does not appear on Mac or Windows installs, with the very telling value MATLAB_ONLINE. My assumption is that a local Linux install would not have that variable, and if a local server did, the value would be different (unless one was running MATLAB Online behind a firewall).
So far I haven’t found a simple way of separating online and mobile versions, apart from a try/catch block containing a command that does not work on the latter (such as uifigure). That’s not very robust–is there a better way?MATLAB has commands such as ispc/ismac/isunix and computer to determine the local computing environment. Is there a way to distinguish MATLAB Online and MATLAB Mobile from a local install? Both the online and mobile versions report themselves as 64-bit Linux, which is presumably the Mathworks server running behind the scenes. Both also have an enviroment variable MW_DDUX_APP_NAME that does not appear on Mac or Windows installs, with the very telling value MATLAB_ONLINE. My assumption is that a local Linux install would not have that variable, and if a local server did, the value would be different (unless one was running MATLAB Online behind a firewall).
So far I haven’t found a simple way of separating online and mobile versions, apart from a try/catch block containing a command that does not work on the latter (such as uifigure). That’s not very robust–is there a better way? MATLAB has commands such as ispc/ismac/isunix and computer to determine the local computing environment. Is there a way to distinguish MATLAB Online and MATLAB Mobile from a local install? Both the online and mobile versions report themselves as 64-bit Linux, which is presumably the Mathworks server running behind the scenes. Both also have an enviroment variable MW_DDUX_APP_NAME that does not appear on Mac or Windows installs, with the very telling value MATLAB_ONLINE. My assumption is that a local Linux install would not have that variable, and if a local server did, the value would be different (unless one was running MATLAB Online behind a firewall).
So far I haven’t found a simple way of separating online and mobile versions, apart from a try/catch block containing a command that does not work on the latter (such as uifigure). That’s not very robust–is there a better way? online, mobile MATLAB Answers — New Questions
RF PCB toolbox analysis inconsistency.
Hi,
I’ve been developing an application using the RF PCB Toolbox for quite some time. Essentially, the application creates a microstrip resonator based on parameters provided by the user and then analyzes its scattering parameters using the Method of Moments (MOM) algorithm. However, my results vary depending on the frequency range of the analysis. The resonator’s frequency response changes in completely unrelated ways, and I can’t figure out why this is happening. My code is intentionally kept simple, without any custom mesh settings or advanced solver configurations.
function SingleLoadedAnalyzeButtonPushed(app, event)
app.FBegin = (app.FBeginField.Value)*1e9;
app.FEnd = (app.FEndField.Value)*1e9;
app.FPoints = (app.FPointsField.Value);
fsweep = linspace(app.FBegin,app.FEnd,app.FPoints);
if app.InterpOptionCheck.Value == 1
interpOption = "interp";
else
interpOption = "direct";
end
spar = sparameters(app.singleResonator,fsweep,…
"SweepOption",interpOption);
rfplot(app.EMResponsePlot,spar);
end
Has anyone experienced similar issues with RF PCB Toolbox for microstrip resonators?Hi,
I’ve been developing an application using the RF PCB Toolbox for quite some time. Essentially, the application creates a microstrip resonator based on parameters provided by the user and then analyzes its scattering parameters using the Method of Moments (MOM) algorithm. However, my results vary depending on the frequency range of the analysis. The resonator’s frequency response changes in completely unrelated ways, and I can’t figure out why this is happening. My code is intentionally kept simple, without any custom mesh settings or advanced solver configurations.
function SingleLoadedAnalyzeButtonPushed(app, event)
app.FBegin = (app.FBeginField.Value)*1e9;
app.FEnd = (app.FEndField.Value)*1e9;
app.FPoints = (app.FPointsField.Value);
fsweep = linspace(app.FBegin,app.FEnd,app.FPoints);
if app.InterpOptionCheck.Value == 1
interpOption = "interp";
else
interpOption = "direct";
end
spar = sparameters(app.singleResonator,fsweep,…
"SweepOption",interpOption);
rfplot(app.EMResponsePlot,spar);
end
Has anyone experienced similar issues with RF PCB Toolbox for microstrip resonators? Hi,
I’ve been developing an application using the RF PCB Toolbox for quite some time. Essentially, the application creates a microstrip resonator based on parameters provided by the user and then analyzes its scattering parameters using the Method of Moments (MOM) algorithm. However, my results vary depending on the frequency range of the analysis. The resonator’s frequency response changes in completely unrelated ways, and I can’t figure out why this is happening. My code is intentionally kept simple, without any custom mesh settings or advanced solver configurations.
function SingleLoadedAnalyzeButtonPushed(app, event)
app.FBegin = (app.FBeginField.Value)*1e9;
app.FEnd = (app.FEndField.Value)*1e9;
app.FPoints = (app.FPointsField.Value);
fsweep = linspace(app.FBegin,app.FEnd,app.FPoints);
if app.InterpOptionCheck.Value == 1
interpOption = "interp";
else
interpOption = "direct";
end
spar = sparameters(app.singleResonator,fsweep,…
"SweepOption",interpOption);
rfplot(app.EMResponsePlot,spar);
end
Has anyone experienced similar issues with RF PCB Toolbox for microstrip resonators? rf pcb toolbox, microstrip, method of moments MATLAB Answers — New Questions
UniqueTol Exclusion of Similar Points
I am trying to remove detected circles that are too close to one another. My original plan involved indexing through all of the centers (X Y stored in separate columns), determining the distances, and then using those to remove points within a tolerance.
for nn=1:height(location_table)
distances=sqrt(((location_table(nn,1) – location_table(:,1)).^2)+((location_table(nn,2) – location_table(:,2)).^2))
too_close=(0<distances & distances<tolerance);
location_table(too_close,:)=[]
end
I was never able to get the removal to work. It would end up breaking if spots were removed because the index nn would eventually get larger than the current table height.
I discovered the uniquetol command when searching for answers. However, in my use of it, it filters out spots that are not unique (ie, within the tolerance). However, I would want it to remove spots that all spots that are too similar (rather than leaving a representative one behind).
location_table=uniquetol(location_table, closeness_tolerance, ‘ByRows’, true, ‘OutputAllIndices’, true, ‘DataScale’,1);
I plan to do radial intensity line scans starting at the center of all circles (and proceeding past their perimeter by a variable) that make it through this filtering process. If spots are too close, then the scan (improfile) will cross over the border of the intended scan as well as a spot that is too close to it (which will skew the data). For example, circle 4 should be excluded because it is too close to other circles and its scans could be skewed. Uniquetold allowed me to exclude the nearby circles but 4 would ideally not be included either.I am trying to remove detected circles that are too close to one another. My original plan involved indexing through all of the centers (X Y stored in separate columns), determining the distances, and then using those to remove points within a tolerance.
for nn=1:height(location_table)
distances=sqrt(((location_table(nn,1) – location_table(:,1)).^2)+((location_table(nn,2) – location_table(:,2)).^2))
too_close=(0<distances & distances<tolerance);
location_table(too_close,:)=[]
end
I was never able to get the removal to work. It would end up breaking if spots were removed because the index nn would eventually get larger than the current table height.
I discovered the uniquetol command when searching for answers. However, in my use of it, it filters out spots that are not unique (ie, within the tolerance). However, I would want it to remove spots that all spots that are too similar (rather than leaving a representative one behind).
location_table=uniquetol(location_table, closeness_tolerance, ‘ByRows’, true, ‘OutputAllIndices’, true, ‘DataScale’,1);
I plan to do radial intensity line scans starting at the center of all circles (and proceeding past their perimeter by a variable) that make it through this filtering process. If spots are too close, then the scan (improfile) will cross over the border of the intended scan as well as a spot that is too close to it (which will skew the data). For example, circle 4 should be excluded because it is too close to other circles and its scans could be skewed. Uniquetold allowed me to exclude the nearby circles but 4 would ideally not be included either. I am trying to remove detected circles that are too close to one another. My original plan involved indexing through all of the centers (X Y stored in separate columns), determining the distances, and then using those to remove points within a tolerance.
for nn=1:height(location_table)
distances=sqrt(((location_table(nn,1) – location_table(:,1)).^2)+((location_table(nn,2) – location_table(:,2)).^2))
too_close=(0<distances & distances<tolerance);
location_table(too_close,:)=[]
end
I was never able to get the removal to work. It would end up breaking if spots were removed because the index nn would eventually get larger than the current table height.
I discovered the uniquetol command when searching for answers. However, in my use of it, it filters out spots that are not unique (ie, within the tolerance). However, I would want it to remove spots that all spots that are too similar (rather than leaving a representative one behind).
location_table=uniquetol(location_table, closeness_tolerance, ‘ByRows’, true, ‘OutputAllIndices’, true, ‘DataScale’,1);
I plan to do radial intensity line scans starting at the center of all circles (and proceeding past their perimeter by a variable) that make it through this filtering process. If spots are too close, then the scan (improfile) will cross over the border of the intended scan as well as a spot that is too close to it (which will skew the data). For example, circle 4 should be excluded because it is too close to other circles and its scans could be skewed. Uniquetold allowed me to exclude the nearby circles but 4 would ideally not be included either. uniquetol, image analysis, image processing MATLAB Answers — New Questions
configure Java path for MATLAB, MATLAB Runtime and deployed applications
MATLAB ships with one specific version of the JRE. This version is validated and fully supported with MATLAB.
However, you can configure MATLAB to use other version of JRE by following this article. Since R2021b, jenv and matlab_jenv commands are introduced to set Java path for MATLAB, which makes this configuration process much easier.
If I used either command and configured MATLAB to use a non-default JRE, how will it impact deployed applications that this MATLAB compiles?
Can I configure JRE for MATLAB Runtime?MATLAB ships with one specific version of the JRE. This version is validated and fully supported with MATLAB.
However, you can configure MATLAB to use other version of JRE by following this article. Since R2021b, jenv and matlab_jenv commands are introduced to set Java path for MATLAB, which makes this configuration process much easier.
If I used either command and configured MATLAB to use a non-default JRE, how will it impact deployed applications that this MATLAB compiles?
Can I configure JRE for MATLAB Runtime? MATLAB ships with one specific version of the JRE. This version is validated and fully supported with MATLAB.
However, you can configure MATLAB to use other version of JRE by following this article. Since R2021b, jenv and matlab_jenv commands are introduced to set Java path for MATLAB, which makes this configuration process much easier.
If I used either command and configured MATLAB to use a non-default JRE, how will it impact deployed applications that this MATLAB compiles?
Can I configure JRE for MATLAB Runtime? MATLAB Answers — New Questions
suprisingly complicated optimization problem
I have the following constrained (global) optimization problem:
For a user defined sorted real values vector:
xi = [xi(1), … , xi(N+1)]
I need to find unknown vector:
x = [x(1), …, x(L)]
where the integer L is the unknown length of the vector x (L>=0, L = 0 is the trivial case)
and the unknown vector x = [x(1), …, x(L)] must satisfy the following specific conditions:
===============================================================
0. The new "refined" sorted vector xo = union(xi,x), where length(xo) = L+N+1
should to fulfil the following set of conditions:
1. min(xo) = xo(1) = xi(1), max(xo) = xo(L+N+1) = xi(N+1)
2a. max(z(j)/z(j+1),z(j+1)/z(j)) < q_max, for j = 1, 2, … L+N
2b. max(z(j-1)/z(j),z(j)/z(j-1)) < q_max, for j = 2, 2, … L+N+1
where
z(j) = xo(j+1) – xo(j) , z = diff(xo), length(z) = L+N
and
q_max is user defined max ratio, where q_max > 1 (typically q_max ~ 1.05 – 1.2)
3. min(z) -> maximal, minimal distance between xo vector elements should be maximized.
It is obvious that for small L the constraint conditions (2) is not possible to satisfy.
===============================================================
The motivation of this problem is the creation of the so called, "homogenized" 1-D grid, where consecutive distances between elements of vector xo are relatively "slowly" changing.
I will be very happy for any recommendation how to effectively solve this problem using MATLAB + (global) optimization toolbox.I have the following constrained (global) optimization problem:
For a user defined sorted real values vector:
xi = [xi(1), … , xi(N+1)]
I need to find unknown vector:
x = [x(1), …, x(L)]
where the integer L is the unknown length of the vector x (L>=0, L = 0 is the trivial case)
and the unknown vector x = [x(1), …, x(L)] must satisfy the following specific conditions:
===============================================================
0. The new "refined" sorted vector xo = union(xi,x), where length(xo) = L+N+1
should to fulfil the following set of conditions:
1. min(xo) = xo(1) = xi(1), max(xo) = xo(L+N+1) = xi(N+1)
2a. max(z(j)/z(j+1),z(j+1)/z(j)) < q_max, for j = 1, 2, … L+N
2b. max(z(j-1)/z(j),z(j)/z(j-1)) < q_max, for j = 2, 2, … L+N+1
where
z(j) = xo(j+1) – xo(j) , z = diff(xo), length(z) = L+N
and
q_max is user defined max ratio, where q_max > 1 (typically q_max ~ 1.05 – 1.2)
3. min(z) -> maximal, minimal distance between xo vector elements should be maximized.
It is obvious that for small L the constraint conditions (2) is not possible to satisfy.
===============================================================
The motivation of this problem is the creation of the so called, "homogenized" 1-D grid, where consecutive distances between elements of vector xo are relatively "slowly" changing.
I will be very happy for any recommendation how to effectively solve this problem using MATLAB + (global) optimization toolbox. I have the following constrained (global) optimization problem:
For a user defined sorted real values vector:
xi = [xi(1), … , xi(N+1)]
I need to find unknown vector:
x = [x(1), …, x(L)]
where the integer L is the unknown length of the vector x (L>=0, L = 0 is the trivial case)
and the unknown vector x = [x(1), …, x(L)] must satisfy the following specific conditions:
===============================================================
0. The new "refined" sorted vector xo = union(xi,x), where length(xo) = L+N+1
should to fulfil the following set of conditions:
1. min(xo) = xo(1) = xi(1), max(xo) = xo(L+N+1) = xi(N+1)
2a. max(z(j)/z(j+1),z(j+1)/z(j)) < q_max, for j = 1, 2, … L+N
2b. max(z(j-1)/z(j),z(j)/z(j-1)) < q_max, for j = 2, 2, … L+N+1
where
z(j) = xo(j+1) – xo(j) , z = diff(xo), length(z) = L+N
and
q_max is user defined max ratio, where q_max > 1 (typically q_max ~ 1.05 – 1.2)
3. min(z) -> maximal, minimal distance between xo vector elements should be maximized.
It is obvious that for small L the constraint conditions (2) is not possible to satisfy.
===============================================================
The motivation of this problem is the creation of the so called, "homogenized" 1-D grid, where consecutive distances between elements of vector xo are relatively "slowly" changing.
I will be very happy for any recommendation how to effectively solve this problem using MATLAB + (global) optimization toolbox. optmization, constrained MATLAB Answers — New Questions
Identify and refill dark spots on the leopard with neighboring pixels
Remove the dark spots on the leopard.
i tried converting the color image into grayscale.Applied ostu thresholding to create binary image.
using the morophological operations i was able to create a mask, used mask to refilll the black spots on the color image. i did not get the desired result.
what other steps i can implement to achieve an image with no black spotsRemove the dark spots on the leopard.
i tried converting the color image into grayscale.Applied ostu thresholding to create binary image.
using the morophological operations i was able to create a mask, used mask to refilll the black spots on the color image. i did not get the desired result.
what other steps i can implement to achieve an image with no black spots Remove the dark spots on the leopard.
i tried converting the color image into grayscale.Applied ostu thresholding to create binary image.
using the morophological operations i was able to create a mask, used mask to refilll the black spots on the color image. i did not get the desired result.
what other steps i can implement to achieve an image with no black spots image processing, image segmentation, hole filling MATLAB Answers — New Questions
The student has not been able to complete the creation of her account because it is blocked. How long will she have to wait before trying to create her account again?
I have a student who tried to create her account but entered the wrong university email address. When she retried with the correct email and set up her password, that part worked. However, when she attempted to log in, she received an error message saying the account was blocked. She then tried to change her password and enter the authentication code, but in all cases the attempts were rejected.
How long will she have to wait before trying to create her account again?
Thank you very much in advance for your help.I have a student who tried to create her account but entered the wrong university email address. When she retried with the correct email and set up her password, that part worked. However, when she attempted to log in, she received an error message saying the account was blocked. She then tried to change her password and enter the authentication code, but in all cases the attempts were rejected.
How long will she have to wait before trying to create her account again?
Thank you very much in advance for your help. I have a student who tried to create her account but entered the wrong university email address. When she retried with the correct email and set up her password, that part worked. However, when she attempted to log in, she received an error message saying the account was blocked. She then tried to change her password and enter the authentication code, but in all cases the attempts were rejected.
How long will she have to wait before trying to create her account again?
Thank you very much in advance for your help. account blocked MATLAB Answers — New Questions
Remove whitespace in Legend with Latex Labels
Hi, does anyone know why there is so much whitespace after each entry in the legend here? I’ve tried to shrink the legend width by doing:
pos = legend.Position;
pos(3) = 0.5*pos(3);
legend.Position = pos;
But this hasn’t worked. I’ve attached the code below.
Any help would be appreciated.
Here is the code below: (I’m sure there is a better way to write the legend names out, but I’m lazy and this was good enough for my purposes).
f = figure;
hold on
plot(Cl, Cm(:,1),"-bsquare")
plot(Cl, Cm(:,3),"-bdiamond")
plot(Cl, Cm(:,5),"-b^")
plot(Cl, Cm(:,7),"-bv")
plot(Cl, Cm(:,2),"-rsquare")
plot(Cl, Cm(:,4),"-rdiamond")
plot(Cl, Cm(:,6),"-r^")
plot(Cl, Cm(:,8),"-rv")
hold off
xlim([-1.1, 1.4])
leg = legend({‘$x_{cg}=0.18bar{c}, delta_e = 0degree $’,’$x_{cg}=0.22bar{c}, delta_e = 0degree $’,’$x_{cg}=0.26bar{c}, delta_e = 0degree $’,’$x_{cg}=0.30bar{c}, delta_e = 0degree $’,’$x_{cg}=0.18bar{c}, delta_e = 5degree $’,’$x_{cg}=0.22bar{c}, delta_e = 5degree $’,’$x_{cg}=0.26bar{c}, delta_e = 5degree $’,’$x_{cg}=0.30bar{c}, delta_e = 5degree $’},’Interpreter’,’latex’, ‘Location’,’northeast’, ‘FontSize’,11);
% pos = leg.Position;
% pos(3) = 0.25*pos(3); % Tried this, didn’t work
% leg.Position = pos;
grid on
ax = gca;
ax.GridLineWidth = 1.5;
ax.XAxis.MinorTick = ‘on’;
ax.XMinorGrid = ‘on’;
ax.YAxis.MinorTick = ‘on’;
ax.YMinorGrid = ‘on’;
f.Units = ‘pixels’;
f.Position = [10,10,990,490];Hi, does anyone know why there is so much whitespace after each entry in the legend here? I’ve tried to shrink the legend width by doing:
pos = legend.Position;
pos(3) = 0.5*pos(3);
legend.Position = pos;
But this hasn’t worked. I’ve attached the code below.
Any help would be appreciated.
Here is the code below: (I’m sure there is a better way to write the legend names out, but I’m lazy and this was good enough for my purposes).
f = figure;
hold on
plot(Cl, Cm(:,1),"-bsquare")
plot(Cl, Cm(:,3),"-bdiamond")
plot(Cl, Cm(:,5),"-b^")
plot(Cl, Cm(:,7),"-bv")
plot(Cl, Cm(:,2),"-rsquare")
plot(Cl, Cm(:,4),"-rdiamond")
plot(Cl, Cm(:,6),"-r^")
plot(Cl, Cm(:,8),"-rv")
hold off
xlim([-1.1, 1.4])
leg = legend({‘$x_{cg}=0.18bar{c}, delta_e = 0degree $’,’$x_{cg}=0.22bar{c}, delta_e = 0degree $’,’$x_{cg}=0.26bar{c}, delta_e = 0degree $’,’$x_{cg}=0.30bar{c}, delta_e = 0degree $’,’$x_{cg}=0.18bar{c}, delta_e = 5degree $’,’$x_{cg}=0.22bar{c}, delta_e = 5degree $’,’$x_{cg}=0.26bar{c}, delta_e = 5degree $’,’$x_{cg}=0.30bar{c}, delta_e = 5degree $’},’Interpreter’,’latex’, ‘Location’,’northeast’, ‘FontSize’,11);
% pos = leg.Position;
% pos(3) = 0.25*pos(3); % Tried this, didn’t work
% leg.Position = pos;
grid on
ax = gca;
ax.GridLineWidth = 1.5;
ax.XAxis.MinorTick = ‘on’;
ax.XMinorGrid = ‘on’;
ax.YAxis.MinorTick = ‘on’;
ax.YMinorGrid = ‘on’;
f.Units = ‘pixels’;
f.Position = [10,10,990,490]; Hi, does anyone know why there is so much whitespace after each entry in the legend here? I’ve tried to shrink the legend width by doing:
pos = legend.Position;
pos(3) = 0.5*pos(3);
legend.Position = pos;
But this hasn’t worked. I’ve attached the code below.
Any help would be appreciated.
Here is the code below: (I’m sure there is a better way to write the legend names out, but I’m lazy and this was good enough for my purposes).
f = figure;
hold on
plot(Cl, Cm(:,1),"-bsquare")
plot(Cl, Cm(:,3),"-bdiamond")
plot(Cl, Cm(:,5),"-b^")
plot(Cl, Cm(:,7),"-bv")
plot(Cl, Cm(:,2),"-rsquare")
plot(Cl, Cm(:,4),"-rdiamond")
plot(Cl, Cm(:,6),"-r^")
plot(Cl, Cm(:,8),"-rv")
hold off
xlim([-1.1, 1.4])
leg = legend({‘$x_{cg}=0.18bar{c}, delta_e = 0degree $’,’$x_{cg}=0.22bar{c}, delta_e = 0degree $’,’$x_{cg}=0.26bar{c}, delta_e = 0degree $’,’$x_{cg}=0.30bar{c}, delta_e = 0degree $’,’$x_{cg}=0.18bar{c}, delta_e = 5degree $’,’$x_{cg}=0.22bar{c}, delta_e = 5degree $’,’$x_{cg}=0.26bar{c}, delta_e = 5degree $’,’$x_{cg}=0.30bar{c}, delta_e = 5degree $’},’Interpreter’,’latex’, ‘Location’,’northeast’, ‘FontSize’,11);
% pos = leg.Position;
% pos(3) = 0.25*pos(3); % Tried this, didn’t work
% leg.Position = pos;
grid on
ax = gca;
ax.GridLineWidth = 1.5;
ax.XAxis.MinorTick = ‘on’;
ax.XMinorGrid = ‘on’;
ax.YAxis.MinorTick = ‘on’;
ax.YMinorGrid = ‘on’;
f.Units = ‘pixels’;
f.Position = [10,10,990,490]; legend MATLAB Answers — New Questions
How to plot an optimization in logarithmic scale?
The following code is expected to plot the output of Rosenbrock’s function against number of iterations ( *for the sake of the problem, don’t be concerned with the quality of the source code*).
function value = banana(x0)
a = x0(1);
b = x0(2);
x = x0(3);
y = x0(4);
value = (1 – x + a)^2 + 100 * (y – b * (x – a)^2)^2;
end
a = int8(4 * rand()) / 2;
b = int8(4 * rand()) / 2;
[x1, y1] = random(a, b);
[x2, y2] = random(a, b);
[x3, y3] = random(a, b);
[x4, y4] = random(a, b);
x = [x1; x2; x3; x4];
y = [y1; y2; y3; y4];
save values.mat;
for i = 1
x0 = [a, b, x(i), y(i)];
options = optimset(‘PlotFcns’, { @optimplotfval });
[solution_point, fval,exitflag,output] = fminsearch(@banana,double(x0),options);
old_x=[x(i),y(i)];
new_x_1 = linspace(-2,2,51);
new_x_2 = linspace(-2,2,51);
for j=1:51
if(new_x_1(j)>= old_x(1))
new_x_1(j)=old_x(1);
break;
end
end
for j=1:51
if(new_x_2(j)>= old_x(2))
new_x_2(j)=old_x(2);
break;
end
end
end
<</matlabcentral/answers/uploaded_files/66646/untitled.png>>
*My questions are,*
(1) Is this plot really showing the output of Rosenbrock’s function against number of iterations?
(2) The plot shows a sudden slump in the output of the function. I need to show this plot in logarithmic form, so that a smooth curve is plotted. How can I do that?The following code is expected to plot the output of Rosenbrock’s function against number of iterations ( *for the sake of the problem, don’t be concerned with the quality of the source code*).
function value = banana(x0)
a = x0(1);
b = x0(2);
x = x0(3);
y = x0(4);
value = (1 – x + a)^2 + 100 * (y – b * (x – a)^2)^2;
end
a = int8(4 * rand()) / 2;
b = int8(4 * rand()) / 2;
[x1, y1] = random(a, b);
[x2, y2] = random(a, b);
[x3, y3] = random(a, b);
[x4, y4] = random(a, b);
x = [x1; x2; x3; x4];
y = [y1; y2; y3; y4];
save values.mat;
for i = 1
x0 = [a, b, x(i), y(i)];
options = optimset(‘PlotFcns’, { @optimplotfval });
[solution_point, fval,exitflag,output] = fminsearch(@banana,double(x0),options);
old_x=[x(i),y(i)];
new_x_1 = linspace(-2,2,51);
new_x_2 = linspace(-2,2,51);
for j=1:51
if(new_x_1(j)>= old_x(1))
new_x_1(j)=old_x(1);
break;
end
end
for j=1:51
if(new_x_2(j)>= old_x(2))
new_x_2(j)=old_x(2);
break;
end
end
end
<</matlabcentral/answers/uploaded_files/66646/untitled.png>>
*My questions are,*
(1) Is this plot really showing the output of Rosenbrock’s function against number of iterations?
(2) The plot shows a sudden slump in the output of the function. I need to show this plot in logarithmic form, so that a smooth curve is plotted. How can I do that? The following code is expected to plot the output of Rosenbrock’s function against number of iterations ( *for the sake of the problem, don’t be concerned with the quality of the source code*).
function value = banana(x0)
a = x0(1);
b = x0(2);
x = x0(3);
y = x0(4);
value = (1 – x + a)^2 + 100 * (y – b * (x – a)^2)^2;
end
a = int8(4 * rand()) / 2;
b = int8(4 * rand()) / 2;
[x1, y1] = random(a, b);
[x2, y2] = random(a, b);
[x3, y3] = random(a, b);
[x4, y4] = random(a, b);
x = [x1; x2; x3; x4];
y = [y1; y2; y3; y4];
save values.mat;
for i = 1
x0 = [a, b, x(i), y(i)];
options = optimset(‘PlotFcns’, { @optimplotfval });
[solution_point, fval,exitflag,output] = fminsearch(@banana,double(x0),options);
old_x=[x(i),y(i)];
new_x_1 = linspace(-2,2,51);
new_x_2 = linspace(-2,2,51);
for j=1:51
if(new_x_1(j)>= old_x(1))
new_x_1(j)=old_x(1);
break;
end
end
for j=1:51
if(new_x_2(j)>= old_x(2))
new_x_2(j)=old_x(2);
break;
end
end
end
<</matlabcentral/answers/uploaded_files/66646/untitled.png>>
*My questions are,*
(1) Is this plot really showing the output of Rosenbrock’s function against number of iterations?
(2) The plot shows a sudden slump in the output of the function. I need to show this plot in logarithmic form, so that a smooth curve is plotted. How can I do that? optimization, plotting, graphics, graph MATLAB Answers — New Questions
Is there a way in Simulink/System Composer to override the drag and drop event?
I wish to drag a block from a different application and drop it into simulink/System Composer. Upon dropping the block, Simulink should call a pre-defined Matlab function.
Is this kind of drop-handler customization possible?I wish to drag a block from a different application and drop it into simulink/System Composer. Upon dropping the block, Simulink should call a pre-defined Matlab function.
Is this kind of drop-handler customization possible? I wish to drag a block from a different application and drop it into simulink/System Composer. Upon dropping the block, Simulink should call a pre-defined Matlab function.
Is this kind of drop-handler customization possible? customization, simulink, systemcomposer, ui MATLAB Answers — New Questions
simulink matlab function dimension error
In my first Matlab function, I set the input to a 4×1 vector, a feedback vector, and a scalar, but the output is a scalar. Please tell me how to make the output a 4×1 vector. I have attached my simulink fileIn my first Matlab function, I set the input to a 4×1 vector, a feedback vector, and a scalar, but the output is a scalar. Please tell me how to make the output a 4×1 vector. I have attached my simulink file In my first Matlab function, I set the input to a 4×1 vector, a feedback vector, and a scalar, but the output is a scalar. Please tell me how to make the output a 4×1 vector. I have attached my simulink file simulink MATLAB Answers — New Questions
Help me understand this PQ Controller Model (ABC to dq-reference using Park Transform) in Simulink
Good day! I’m currently having troubles interpreting this block diagram of a PQ controller, which I will be applying for BESS support in a bus network.
Right now, I’m figuring out how I should implement the Park Transform block to convert from ABC to dq reference in Simulink. I’m also confused when I should implement the transfer functions and PI controllers (considering the dq-reference).
If any further context is needed, I will try my best to provide more.
Also, if you are an expert in control modeling, especially in BESS, I would love to keep in contact with you for more help, as I have more questions with regards to my BESS model for voltage and frequency support.
Thank you very much!Good day! I’m currently having troubles interpreting this block diagram of a PQ controller, which I will be applying for BESS support in a bus network.
Right now, I’m figuring out how I should implement the Park Transform block to convert from ABC to dq reference in Simulink. I’m also confused when I should implement the transfer functions and PI controllers (considering the dq-reference).
If any further context is needed, I will try my best to provide more.
Also, if you are an expert in control modeling, especially in BESS, I would love to keep in contact with you for more help, as I have more questions with regards to my BESS model for voltage and frequency support.
Thank you very much! Good day! I’m currently having troubles interpreting this block diagram of a PQ controller, which I will be applying for BESS support in a bus network.
Right now, I’m figuring out how I should implement the Park Transform block to convert from ABC to dq reference in Simulink. I’m also confused when I should implement the transfer functions and PI controllers (considering the dq-reference).
If any further context is needed, I will try my best to provide more.
Also, if you are an expert in control modeling, especially in BESS, I would love to keep in contact with you for more help, as I have more questions with regards to my BESS model for voltage and frequency support.
Thank you very much! simulink, control, transfer function MATLAB Answers — New Questions
Unable to use structName.?ClassName for VideoWriter class
I am finding the structName.?ClassName method of arguments validation does not work when trying to validate name-value arguments for the VideoWriter class.
I have a short function:
function myDemo(videoData,fileName,vwOpts)
arguments
videoData
fileName
vwOpts.?VideoWriter
end
disp(vwOpts);
videoObj = VideoWriter(fileName);
% Open video, write, close, etc.
end % MakeVideo
I would expect that calling this function with VideoWriter properties such as FrameRate would result in vwOpts being a struct that contains values passed to the function. However, I am getting the error:
>> myDemo(0:10,"myVideo.avi","FrameRate",20)
Error using myDemo
Too many input arguments.
I validated my approach by attempting to filter for arguments to the Bar() function by mimicking the matlab.graphics.chart.primitive.Bar example shown in the documentation and was successful.
I noticed I get this same error when failing to specify the full name of the Bar class, so looked for other methods of specifying the VideoWriter class, using matlab.audiovideo.VideoWriter as the full class name, with no success.
What am I missing about this approach? Is there a way of locating the full name of the VideoWriter class, or is there some reason I should not expect this example to work?
Thanks!I am finding the structName.?ClassName method of arguments validation does not work when trying to validate name-value arguments for the VideoWriter class.
I have a short function:
function myDemo(videoData,fileName,vwOpts)
arguments
videoData
fileName
vwOpts.?VideoWriter
end
disp(vwOpts);
videoObj = VideoWriter(fileName);
% Open video, write, close, etc.
end % MakeVideo
I would expect that calling this function with VideoWriter properties such as FrameRate would result in vwOpts being a struct that contains values passed to the function. However, I am getting the error:
>> myDemo(0:10,"myVideo.avi","FrameRate",20)
Error using myDemo
Too many input arguments.
I validated my approach by attempting to filter for arguments to the Bar() function by mimicking the matlab.graphics.chart.primitive.Bar example shown in the documentation and was successful.
I noticed I get this same error when failing to specify the full name of the Bar class, so looked for other methods of specifying the VideoWriter class, using matlab.audiovideo.VideoWriter as the full class name, with no success.
What am I missing about this approach? Is there a way of locating the full name of the VideoWriter class, or is there some reason I should not expect this example to work?
Thanks! I am finding the structName.?ClassName method of arguments validation does not work when trying to validate name-value arguments for the VideoWriter class.
I have a short function:
function myDemo(videoData,fileName,vwOpts)
arguments
videoData
fileName
vwOpts.?VideoWriter
end
disp(vwOpts);
videoObj = VideoWriter(fileName);
% Open video, write, close, etc.
end % MakeVideo
I would expect that calling this function with VideoWriter properties such as FrameRate would result in vwOpts being a struct that contains values passed to the function. However, I am getting the error:
>> myDemo(0:10,"myVideo.avi","FrameRate",20)
Error using myDemo
Too many input arguments.
I validated my approach by attempting to filter for arguments to the Bar() function by mimicking the matlab.graphics.chart.primitive.Bar example shown in the documentation and was successful.
I noticed I get this same error when failing to specify the full name of the Bar class, so looked for other methods of specifying the VideoWriter class, using matlab.audiovideo.VideoWriter as the full class name, with no success.
What am I missing about this approach? Is there a way of locating the full name of the VideoWriter class, or is there some reason I should not expect this example to work?
Thanks! arguments validation MATLAB Answers — New Questions
using standalone app designer how to print figure using pushbutton ,thanks .
using standalone app designer need to using pushbutton to print figures.using standalone app designer need to using pushbutton to print figures. using standalone app designer need to using pushbutton to print figures. app designer, print figure of standalone app designer using push MATLAB Answers — New Questions









