Author: PuTI
I am not able to use learn MATLAB in offline
When I open MATLAB R2025b with my Demo license , when I go to home page and Click on ‘Learn MATLAB’ it takes me to browser , and when i try to learn course in browser it is saying it is recommend to use MATLAB software , but i am not finding any way how can i start the course in matlab softwareWhen I open MATLAB R2025b with my Demo license , when I go to home page and Click on ‘Learn MATLAB’ it takes me to browser , and when i try to learn course in browser it is saying it is recommend to use MATLAB software , but i am not finding any way how can i start the course in matlab software When I open MATLAB R2025b with my Demo license , when I go to home page and Click on ‘Learn MATLAB’ it takes me to browser , and when i try to learn course in browser it is saying it is recommend to use MATLAB software , but i am not finding any way how can i start the course in matlab software learn matlab, simulink, onramp MATLAB Answers — New Questions
How can I : Develop equations to define geometric primitives?
I am trying to develop a code that will define geometric primitives using equations. the shapes to be identified are, square, circle, rectangle and triangle. When i run my programme it seems to detect all shapes as rectangle.I am trying to develop a code that will define geometric primitives using equations. the shapes to be identified are, square, circle, rectangle and triangle. When i run my programme it seems to detect all shapes as rectangle. I am trying to develop a code that will define geometric primitives using equations. the shapes to be identified are, square, circle, rectangle and triangle. When i run my programme it seems to detect all shapes as rectangle. image processing MATLAB Answers — New Questions
How to disable interactions with DonutChart objects?
Hi everyone,
I’m using the donutchart function (which returns a DonutChart object) and I’m looking for a supported way to disable chart interactions—specifically:
Data tips
The export interaction
For conventional plots (for example, line plots, scatter plots), I can usually disable interactions at the axes level. However, for donut charts I haven’t found an approach that reliably disables these interactions on the DonutChart object itself.
If anyone has a method (or knows whether this is currently not configurable for DonutChart), I’d really appreciate guidance.
Thanks a lot!
Best regards,
RalfHi everyone,
I’m using the donutchart function (which returns a DonutChart object) and I’m looking for a supported way to disable chart interactions—specifically:
Data tips
The export interaction
For conventional plots (for example, line plots, scatter plots), I can usually disable interactions at the axes level. However, for donut charts I haven’t found an approach that reliably disables these interactions on the DonutChart object itself.
If anyone has a method (or knows whether this is currently not configurable for DonutChart), I’d really appreciate guidance.
Thanks a lot!
Best regards,
Ralf Hi everyone,
I’m using the donutchart function (which returns a DonutChart object) and I’m looking for a supported way to disable chart interactions—specifically:
Data tips
The export interaction
For conventional plots (for example, line plots, scatter plots), I can usually disable interactions at the axes level. However, for donut charts I haven’t found an approach that reliably disables these interactions on the DonutChart object itself.
If anyone has a method (or knows whether this is currently not configurable for DonutChart), I’d really appreciate guidance.
Thanks a lot!
Best regards,
Ralf donutchart, donut chart MATLAB Answers — New Questions
Code generation fails with PLCnext Target for Simulink: pxc_plcn_make_rtw_hook error “Unrecognized method, property, or field ‘Identifier’ for class ‘MException'”
I am trying to generate code from a Simulink model using PLCnext Target for Simulink.
The model runs correctly in simulation, but code generation fails during the build process.
The build stops with the following error:
The call to pxc_plcn_make_rtw_hook, during the exit hook generated the following error:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
The build process will terminate as a result.
Caused by:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
This happens when runs “generate code”
Model configuration:
System target file: pxc_plcn.tlc
Template makefile: pxc_plcn.tmf
Generate code only: enabled
Language: C++
The error appears in the pxc_plcn_make_rtw_hook during the exit hook phase.
Is this related to an incompatibility between the PLCnext Target for Simulink and the MATLAB version, or is there a known issue with this hook?I am trying to generate code from a Simulink model using PLCnext Target for Simulink.
The model runs correctly in simulation, but code generation fails during the build process.
The build stops with the following error:
The call to pxc_plcn_make_rtw_hook, during the exit hook generated the following error:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
The build process will terminate as a result.
Caused by:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
This happens when runs “generate code”
Model configuration:
System target file: pxc_plcn.tlc
Template makefile: pxc_plcn.tmf
Generate code only: enabled
Language: C++
The error appears in the pxc_plcn_make_rtw_hook during the exit hook phase.
Is this related to an incompatibility between the PLCnext Target for Simulink and the MATLAB version, or is there a known issue with this hook? I am trying to generate code from a Simulink model using PLCnext Target for Simulink.
The model runs correctly in simulation, but code generation fails during the build process.
The build stops with the following error:
The call to pxc_plcn_make_rtw_hook, during the exit hook generated the following error:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
The build process will terminate as a result.
Caused by:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
This happens when runs “generate code”
Model configuration:
System target file: pxc_plcn.tlc
Template makefile: pxc_plcn.tmf
Generate code only: enabled
Language: C++
The error appears in the pxc_plcn_make_rtw_hook during the exit hook phase.
Is this related to an incompatibility between the PLCnext Target for Simulink and the MATLAB version, or is there a known issue with this hook? simulink, code-generation, plcnext MATLAB Answers — New Questions
I’d like to run the example that uses the Support Package for Parrot Drones to perform the basic flight operations. What’s the proc
Here is the MATLAB script. The drone is already connected to PC:
p = parrot();
takeoff(p);
pause (2);
land(p);
takeoff(p);
movement_step = 1;
while(movement_step <= 4 && p.BatteryLevel > 10)
moveforward(p, 2);
turn(p, deg2rad(90));
movement_step = movement_step + 1;
end
land(p);
takeoff(p);
move(p, 5, ‘Roll’, deg2rad(4), ‘RotationSpeed’, deg2rad(120));
land(p);
takeoff(p);
move(p, 5, ‘Pitch’, deg2rad(-4), ‘Roll’, deg2rad(4));
land(p);
clear p;Here is the MATLAB script. The drone is already connected to PC:
p = parrot();
takeoff(p);
pause (2);
land(p);
takeoff(p);
movement_step = 1;
while(movement_step <= 4 && p.BatteryLevel > 10)
moveforward(p, 2);
turn(p, deg2rad(90));
movement_step = movement_step + 1;
end
land(p);
takeoff(p);
move(p, 5, ‘Roll’, deg2rad(4), ‘RotationSpeed’, deg2rad(120));
land(p);
takeoff(p);
move(p, 5, ‘Pitch’, deg2rad(-4), ‘Roll’, deg2rad(4));
land(p);
clear p; Here is the MATLAB script. The drone is already connected to PC:
p = parrot();
takeoff(p);
pause (2);
land(p);
takeoff(p);
movement_step = 1;
while(movement_step <= 4 && p.BatteryLevel > 10)
moveforward(p, 2);
turn(p, deg2rad(90));
movement_step = movement_step + 1;
end
land(p);
takeoff(p);
move(p, 5, ‘Roll’, deg2rad(4), ‘RotationSpeed’, deg2rad(120));
land(p);
takeoff(p);
move(p, 5, ‘Pitch’, deg2rad(-4), ‘Roll’, deg2rad(4));
land(p);
clear p; script, matlab MATLAB Answers — New Questions
Good day my good people, how can we plot the classical variables and the main equations under variation of parameters in bvp4c?
And the classical variables are:
The bvp4c code of the problem is:
function sisko5
% Parameter initialization
A = 1;
M = 1;
n = 2;
m = 1;
gamma = 1;
Nt = 1;
Nb = 1;
GrT = 1;
GrC = 2;
Rd = 1;
Sc = 1;
Pr = 1;
Ec = 1;
% Constant calculation
Costant = (m*(2*n – 1) + 1) / (n + 1);
% System of ODE
function dydx = odefun(~, y)
%f = y(1), f’ = y(2), f” = y(3), theta = y(4), theta’ = y(5), phi = y(6), phi’ = y(7)
dydx = zeros(7, 1);
dydx(1) = y(2);
dydx(2) = y(3);
dydx(3) = (-Costant*y(1)*y(3) + m*y(2)^2 – GrT*y(4) – GrC*y(6) + M*y(2))/(A + n*(-y(3))^(n-1));
dydx(4) = y(5);
dydx(5) = (-Costant*y(1)*y(5) – Nb*y(5)*y(7) – Nt*y(5)^2 – Ec*A*y(3)^2 – Ec*(-y(3))^(n+1) – M*Ec*y(2)^2)/((1+4/3*Rd)/Pr);
dydx(6) = y(7);
dydx(7) = -Sc*Costant*y(1)*y(7) – (Nt/Nb)*dydx(5) + gamma*y(6);
end
% Nested function: Boundary conditions
function res = bcfun(ya, yb)
res = zeros(7, 1);
res(1) = ya(2)-1; % y(2) = 1 at eta = 0
res(2) = ya(1); % y(1) = 0 at eta = 0
res(3) = ya(4)-1; % y(4) = 1 at eta = 0
res(4) = Nb*ya(7) + Nt*ya(5); % Boundary condition at eta = 0
res(5) = yb(2); % y(2) = 0 at eta = 10
res(6) = yb(4); % y(4) = 0 at eta = 10
res(7) = yb(6); % y(6) = 0 at eta = 10
end
solinit=bvpinit(linspace(0,10,10),[0 0 0 0 0 0 0]);
sol=bvp4c(@odefun,@bcfun,solinit);
eta=linspace(0,10,100);
y=deval(sol,eta);
plot(eta,y(6,:))
end
Is it possible to do plot under variation of parameter in bvp4c method? It has been a chalenge for me honestly. Can anyone help my good peolple?And the classical variables are:
The bvp4c code of the problem is:
function sisko5
% Parameter initialization
A = 1;
M = 1;
n = 2;
m = 1;
gamma = 1;
Nt = 1;
Nb = 1;
GrT = 1;
GrC = 2;
Rd = 1;
Sc = 1;
Pr = 1;
Ec = 1;
% Constant calculation
Costant = (m*(2*n – 1) + 1) / (n + 1);
% System of ODE
function dydx = odefun(~, y)
%f = y(1), f’ = y(2), f” = y(3), theta = y(4), theta’ = y(5), phi = y(6), phi’ = y(7)
dydx = zeros(7, 1);
dydx(1) = y(2);
dydx(2) = y(3);
dydx(3) = (-Costant*y(1)*y(3) + m*y(2)^2 – GrT*y(4) – GrC*y(6) + M*y(2))/(A + n*(-y(3))^(n-1));
dydx(4) = y(5);
dydx(5) = (-Costant*y(1)*y(5) – Nb*y(5)*y(7) – Nt*y(5)^2 – Ec*A*y(3)^2 – Ec*(-y(3))^(n+1) – M*Ec*y(2)^2)/((1+4/3*Rd)/Pr);
dydx(6) = y(7);
dydx(7) = -Sc*Costant*y(1)*y(7) – (Nt/Nb)*dydx(5) + gamma*y(6);
end
% Nested function: Boundary conditions
function res = bcfun(ya, yb)
res = zeros(7, 1);
res(1) = ya(2)-1; % y(2) = 1 at eta = 0
res(2) = ya(1); % y(1) = 0 at eta = 0
res(3) = ya(4)-1; % y(4) = 1 at eta = 0
res(4) = Nb*ya(7) + Nt*ya(5); % Boundary condition at eta = 0
res(5) = yb(2); % y(2) = 0 at eta = 10
res(6) = yb(4); % y(4) = 0 at eta = 10
res(7) = yb(6); % y(6) = 0 at eta = 10
end
solinit=bvpinit(linspace(0,10,10),[0 0 0 0 0 0 0]);
sol=bvp4c(@odefun,@bcfun,solinit);
eta=linspace(0,10,100);
y=deval(sol,eta);
plot(eta,y(6,:))
end
Is it possible to do plot under variation of parameter in bvp4c method? It has been a chalenge for me honestly. Can anyone help my good peolple? And the classical variables are:
The bvp4c code of the problem is:
function sisko5
% Parameter initialization
A = 1;
M = 1;
n = 2;
m = 1;
gamma = 1;
Nt = 1;
Nb = 1;
GrT = 1;
GrC = 2;
Rd = 1;
Sc = 1;
Pr = 1;
Ec = 1;
% Constant calculation
Costant = (m*(2*n – 1) + 1) / (n + 1);
% System of ODE
function dydx = odefun(~, y)
%f = y(1), f’ = y(2), f” = y(3), theta = y(4), theta’ = y(5), phi = y(6), phi’ = y(7)
dydx = zeros(7, 1);
dydx(1) = y(2);
dydx(2) = y(3);
dydx(3) = (-Costant*y(1)*y(3) + m*y(2)^2 – GrT*y(4) – GrC*y(6) + M*y(2))/(A + n*(-y(3))^(n-1));
dydx(4) = y(5);
dydx(5) = (-Costant*y(1)*y(5) – Nb*y(5)*y(7) – Nt*y(5)^2 – Ec*A*y(3)^2 – Ec*(-y(3))^(n+1) – M*Ec*y(2)^2)/((1+4/3*Rd)/Pr);
dydx(6) = y(7);
dydx(7) = -Sc*Costant*y(1)*y(7) – (Nt/Nb)*dydx(5) + gamma*y(6);
end
% Nested function: Boundary conditions
function res = bcfun(ya, yb)
res = zeros(7, 1);
res(1) = ya(2)-1; % y(2) = 1 at eta = 0
res(2) = ya(1); % y(1) = 0 at eta = 0
res(3) = ya(4)-1; % y(4) = 1 at eta = 0
res(4) = Nb*ya(7) + Nt*ya(5); % Boundary condition at eta = 0
res(5) = yb(2); % y(2) = 0 at eta = 10
res(6) = yb(4); % y(4) = 0 at eta = 10
res(7) = yb(6); % y(6) = 0 at eta = 10
end
solinit=bvpinit(linspace(0,10,10),[0 0 0 0 0 0 0]);
sol=bvp4c(@odefun,@bcfun,solinit);
eta=linspace(0,10,100);
y=deval(sol,eta);
plot(eta,y(6,:))
end
Is it possible to do plot under variation of parameter in bvp4c method? It has been a chalenge for me honestly. Can anyone help my good peolple? bvp4c, fluid dynamics MATLAB Answers — New Questions
Unable to connect to given URL.
url = ‘https://fred.stlouisfed.org/’;
c = fred(url);
Unable to connect to given URL.url = ‘https://fred.stlouisfed.org/’;
c = fred(url);
Unable to connect to given URL. url = ‘https://fred.stlouisfed.org/’;
c = fred(url);
Unable to connect to given URL. fred MATLAB Answers — New Questions
I want to install Matlab 2010b on a new (2026) HP desktop
How do I install an old version of Matlab (2010b I believe) on a brand new HP desktop running Windows 11? I have the original CDs, but not a valid PLP. (personal license passcode). LeoHow do I install an old version of Matlab (2010b I believe) on a brand new HP desktop running Windows 11? I have the original CDs, but not a valid PLP. (personal license passcode). Leo How do I install an old version of Matlab (2010b I believe) on a brand new HP desktop running Windows 11? I have the original CDs, but not a valid PLP. (personal license passcode). Leo install on a new machine MATLAB Answers — New Questions
Running uitests in parallel
I have a large app with many test cases that I would like to be able run in parallel. However the uitest framework functions (type, press etc. ) all fail when run in parallel due to MATLAB:uiautomation:Driver:NoDisplay. Is there a way to set up the parpool to allow this?
I provide an example of this with a simple file selector app that uses uigetfile to select a file. If the file exists then the first line is written to a label in the app, otherwise an error message is written. The testing utilizes the uitest framework function "press" in both tests and it failes due to the error above when run in parallel. When run without parallel processes both tests pass without errors.
(I borrowed the original code base from the example provided in the answer linked below and modified it for this question)
https://www.mathworks.com/matlabcentral/answers/1989568-create-a-test-case-with-uitest-class-using-uigetfile-and-uiputfileI have a large app with many test cases that I would like to be able run in parallel. However the uitest framework functions (type, press etc. ) all fail when run in parallel due to MATLAB:uiautomation:Driver:NoDisplay. Is there a way to set up the parpool to allow this?
I provide an example of this with a simple file selector app that uses uigetfile to select a file. If the file exists then the first line is written to a label in the app, otherwise an error message is written. The testing utilizes the uitest framework function "press" in both tests and it failes due to the error above when run in parallel. When run without parallel processes both tests pass without errors.
(I borrowed the original code base from the example provided in the answer linked below and modified it for this question)
https://www.mathworks.com/matlabcentral/answers/1989568-create-a-test-case-with-uitest-class-using-uigetfile-and-uiputfile I have a large app with many test cases that I would like to be able run in parallel. However the uitest framework functions (type, press etc. ) all fail when run in parallel due to MATLAB:uiautomation:Driver:NoDisplay. Is there a way to set up the parpool to allow this?
I provide an example of this with a simple file selector app that uses uigetfile to select a file. If the file exists then the first line is written to a label in the app, otherwise an error message is written. The testing utilizes the uitest framework function "press" in both tests and it failes due to the error above when run in parallel. When run without parallel processes both tests pass without errors.
(I borrowed the original code base from the example provided in the answer linked below and modified it for this question)
https://www.mathworks.com/matlabcentral/answers/1989568-create-a-test-case-with-uitest-class-using-uigetfile-and-uiputfile parallel computing, uitest, unittest MATLAB Answers — New Questions
I am using the UCIe 2.0 Standard Package Signal Integrity Kit. Could you tell me where the VTF script is located?
I would like to ask for your guidance regarding my use of the UCIe 2.0 Standard Package Signal Integrity Kit.
In the documentation, a script (run_plotVTF.m) for calculating the VTF is mentioned, as illustrated in the figure below. However, I was not able to locate this file after searching through the provided package.
I also have an additional question: is it possible to run the VTF calculation tool independently, without waiting for the coupled widebus simulation to be completed?
Based on my understanding, the VTF simulation itself is essentially a passive simulation.I would like to ask for your guidance regarding my use of the UCIe 2.0 Standard Package Signal Integrity Kit.
In the documentation, a script (run_plotVTF.m) for calculating the VTF is mentioned, as illustrated in the figure below. However, I was not able to locate this file after searching through the provided package.
I also have an additional question: is it possible to run the VTF calculation tool independently, without waiting for the coupled widebus simulation to be completed?
Based on my understanding, the VTF simulation itself is essentially a passive simulation. I would like to ask for your guidance regarding my use of the UCIe 2.0 Standard Package Signal Integrity Kit.
In the documentation, a script (run_plotVTF.m) for calculating the VTF is mentioned, as illustrated in the figure below. However, I was not able to locate this file after searching through the provided package.
I also have an additional question: is it possible to run the VTF calculation tool independently, without waiting for the coupled widebus simulation to be completed?
Based on my understanding, the VTF simulation itself is essentially a passive simulation. ucie 2.0, parallel link designer, vtf, script MATLAB Answers — New Questions
fixed point tool collect ranges problem
The input of the subsystem to be converted to fixed point in double and specified data types differ significantly,almost one thousand times.And there are many overflows in double mode,and few overflows in specified data types mode.Looking forward to your reply,thank you.The input of the subsystem to be converted to fixed point in double and specified data types differ significantly,almost one thousand times.And there are many overflows in double mode,and few overflows in specified data types mode.Looking forward to your reply,thank you. The input of the subsystem to be converted to fixed point in double and specified data types differ significantly,almost one thousand times.And there are many overflows in double mode,and few overflows in specified data types mode.Looking forward to your reply,thank you. fixed point tool, collect ranges MATLAB Answers — New Questions
Does the Vehicle Network Toolbox currently support PCAN-Developer API where I can have Simulink act as a Client connected to a Net without any hardware?
I would like to have Simulink act as a Client connected to a Net without any hardware using the PCAN-Developer 4 API, which is specified in the link below:
https://www.peak-system.com/products/software/development-packages/pcan-developer/?L=1
Is this currently supported with MATLAB and Simulink?I would like to have Simulink act as a Client connected to a Net without any hardware using the PCAN-Developer 4 API, which is specified in the link below:
https://www.peak-system.com/products/software/development-packages/pcan-developer/?L=1
Is this currently supported with MATLAB and Simulink? I would like to have Simulink act as a Client connected to a Net without any hardware using the PCAN-Developer 4 API, which is specified in the link below:
https://www.peak-system.com/products/software/development-packages/pcan-developer/?L=1
Is this currently supported with MATLAB and Simulink? vehiclenetworktoolbox, simulink, pcan MATLAB Answers — New Questions
I cant find UR18650ZTA in matlab training for battery builder
I cant find UR18650ZTA battery part number in matlab training for battery builder — I put the manufacturer as Panasonic and still I am not able to find the part number. The excersise specifically asks for this part number and I can’t find it — Can someone please helpI cant find UR18650ZTA battery part number in matlab training for battery builder — I put the manufacturer as Panasonic and still I am not able to find the part number. The excersise specifically asks for this part number and I can’t find it — Can someone please help I cant find UR18650ZTA battery part number in matlab training for battery builder — I put the manufacturer as Panasonic and still I am not able to find the part number. The excersise specifically asks for this part number and I can’t find it — Can someone please help #battery builder MATLAB Answers — New Questions
Anyone have BCM/VCU or control module models in Simulink?
Hi everyone,
I’m currently learning to build control modules using Simulink and MATLAB. I was wondering if anyone has experience with or access to BCM, VCU, or other control module models in Simulink.
If you have any models (especially with sensor data integration) that you can share, it would be really helpful. I’m currently using MATLAB 2021a.
Thanks in advance!Hi everyone,
I’m currently learning to build control modules using Simulink and MATLAB. I was wondering if anyone has experience with or access to BCM, VCU, or other control module models in Simulink.
If you have any models (especially with sensor data integration) that you can share, it would be really helpful. I’m currently using MATLAB 2021a.
Thanks in advance! Hi everyone,
I’m currently learning to build control modules using Simulink and MATLAB. I was wondering if anyone has experience with or access to BCM, VCU, or other control module models in Simulink.
If you have any models (especially with sensor data integration) that you can share, it would be really helpful. I’m currently using MATLAB 2021a.
Thanks in advance! vcu, ecu, bcm MATLAB Answers — New Questions
How to add one extra seat for a different computer on an existing license?
I have a Matlab home license (#xxxxxxx) with one seat already installed on one computer. I need to activate a second seat on a different computer while keeping the first seat actived. How to add an extra activation/ seat?I have a Matlab home license (#xxxxxxx) with one seat already installed on one computer. I need to activate a second seat on a different computer while keeping the first seat actived. How to add an extra activation/ seat? I have a Matlab home license (#xxxxxxx) with one seat already installed on one computer. I need to activate a second seat on a different computer while keeping the first seat actived. How to add an extra activation/ seat? matlab activation MATLAB Answers — New Questions
raspberry pi connect in HW resource mgr – sudo user privilege test status not enabled
How to get the privilege test status indicatoe to green so that the next provedure ocuresHow to get the privilege test status indicatoe to green so that the next provedure ocures How to get the privilege test status indicatoe to green so that the next provedure ocures pi sudo MATLAB Answers — New Questions
Looking for addon name
I found a simulink model that contains a missing block from standard library. I have search it on google, but nothing was found. Does anyone know addon/library name/link for this block? Thank you.I found a simulink model that contains a missing block from standard library. I have search it on google, but nothing was found. Does anyone know addon/library name/link for this block? Thank you. I found a simulink model that contains a missing block from standard library. I have search it on google, but nothing was found. Does anyone know addon/library name/link for this block? Thank you. simulink MATLAB Answers — New Questions
Separate tools setting callbacks for one event
Consider two tools that add annotations to a plot. Both toolA and toolB add annotations that are sensitive to the current YLim of the axis. toolA and toolB are completely independent. Either one or both may be used on any given plot.
Both tools add annotations that must be placed relative to one another within their set. For example, a series of labels that "stair step" down as the x-axis increases. So the position of any individual label has some dependence on the "previous" label (text object).
I have found that just adding a listener on YLim PostSet is insufficient, as the "Restore View" for zoom does not stimulate that callback. I have found I also need the same callback(s) invoked if the figure size is changed. I am aware of the LimitsChanged callback for axis objects and the SizeChanged callback for the figure objects, but as far as I can tell they can only point to a single callback function, not a list of functions.
I have figured out some rather hacky ways to handle this use case, but I’m wondering if there is a preferred method for doing something like this. It seems that addlistener would be the preferred way as that doesn’t overwrite a property, but I’ve been unable to find a way to get that to reliably work for all use cases (like zooming and figure resizing).
[Note that I am currently using R2022b, but there are others in our group that currently need to use MATLAB as old as R2018b. We have a number of mission-critical tools that need to be recertified if the version of MATLAB changes, so there can be lags adopting the lastest version of MATLAB.]Consider two tools that add annotations to a plot. Both toolA and toolB add annotations that are sensitive to the current YLim of the axis. toolA and toolB are completely independent. Either one or both may be used on any given plot.
Both tools add annotations that must be placed relative to one another within their set. For example, a series of labels that "stair step" down as the x-axis increases. So the position of any individual label has some dependence on the "previous" label (text object).
I have found that just adding a listener on YLim PostSet is insufficient, as the "Restore View" for zoom does not stimulate that callback. I have found I also need the same callback(s) invoked if the figure size is changed. I am aware of the LimitsChanged callback for axis objects and the SizeChanged callback for the figure objects, but as far as I can tell they can only point to a single callback function, not a list of functions.
I have figured out some rather hacky ways to handle this use case, but I’m wondering if there is a preferred method for doing something like this. It seems that addlistener would be the preferred way as that doesn’t overwrite a property, but I’ve been unable to find a way to get that to reliably work for all use cases (like zooming and figure resizing).
[Note that I am currently using R2022b, but there are others in our group that currently need to use MATLAB as old as R2018b. We have a number of mission-critical tools that need to be recertified if the version of MATLAB changes, so there can be lags adopting the lastest version of MATLAB.] Consider two tools that add annotations to a plot. Both toolA and toolB add annotations that are sensitive to the current YLim of the axis. toolA and toolB are completely independent. Either one or both may be used on any given plot.
Both tools add annotations that must be placed relative to one another within their set. For example, a series of labels that "stair step" down as the x-axis increases. So the position of any individual label has some dependence on the "previous" label (text object).
I have found that just adding a listener on YLim PostSet is insufficient, as the "Restore View" for zoom does not stimulate that callback. I have found I also need the same callback(s) invoked if the figure size is changed. I am aware of the LimitsChanged callback for axis objects and the SizeChanged callback for the figure objects, but as far as I can tell they can only point to a single callback function, not a list of functions.
I have figured out some rather hacky ways to handle this use case, but I’m wondering if there is a preferred method for doing something like this. It seems that addlistener would be the preferred way as that doesn’t overwrite a property, but I’ve been unable to find a way to get that to reliably work for all use cases (like zooming and figure resizing).
[Note that I am currently using R2022b, but there are others in our group that currently need to use MATLAB as old as R2018b. We have a number of mission-critical tools that need to be recertified if the version of MATLAB changes, so there can be lags adopting the lastest version of MATLAB.] callback, figure MATLAB Answers — New Questions
How do I request physical media?
I need physical media in order to download the products. How do I request physical media?I need physical media in order to download the products. How do I request physical media? I need physical media in order to download the products. How do I request physical media? MATLAB Answers — New Questions
How do I access my Online Training Suite?
How do I access my Online Training Suite?How do I access my Online Training Suite? How do I access my Online Training Suite? MATLAB Answers — New Questions









