Month: October 2025
the save as option in the axis toolbar i causing the custom x label to collapse .
I an using app designer , the save as option in the axis toolbar i causing the custom x label to collapse and is saving the wrong label position because of it. How to fix the issueI an using app designer , the save as option in the axis toolbar i causing the custom x label to collapse and is saving the wrong label position because of it. How to fix the issue I an using app designer , the save as option in the axis toolbar i causing the custom x label to collapse and is saving the wrong label position because of it. How to fix the issue save as MATLAB Answers — New Questions
Simscape fluids error cylinder area parametrization
Hello i am a university student and i am trying to build a hydraulic system for a crane miniature. My hydraulic system has the my defined values but i am getting the error: Error:An error occurred during simulation and the simulation was terminated
Caused by:
[‘test_hydraulics/Solver Configuration1’]: At time 0.498629, one or more assertions are triggered. See causes for specific information.
Liquid volume must be greater than minimum physical volume. The assertion comes from:
Block path: test_hydraulics/Double-Acting Actuator (IL)1
Assert location:
o In between line: 242, column: 5 and line: 242, column: 11 in file: foundation.isothermal_liquid.elements.translational_mechanical_converter
o In between line: 386, column: 17 and line: 395, column: 39 in file: fluids.isothermal_liquid.actuators.double_actuator
I dont know what to do i tried editing the parameters and i noticed that when i change my actuator area paramters from m^2 to cm^2 it works.
Thanks in advance!Hello i am a university student and i am trying to build a hydraulic system for a crane miniature. My hydraulic system has the my defined values but i am getting the error: Error:An error occurred during simulation and the simulation was terminated
Caused by:
[‘test_hydraulics/Solver Configuration1’]: At time 0.498629, one or more assertions are triggered. See causes for specific information.
Liquid volume must be greater than minimum physical volume. The assertion comes from:
Block path: test_hydraulics/Double-Acting Actuator (IL)1
Assert location:
o In between line: 242, column: 5 and line: 242, column: 11 in file: foundation.isothermal_liquid.elements.translational_mechanical_converter
o In between line: 386, column: 17 and line: 395, column: 39 in file: fluids.isothermal_liquid.actuators.double_actuator
I dont know what to do i tried editing the parameters and i noticed that when i change my actuator area paramters from m^2 to cm^2 it works.
Thanks in advance! Hello i am a university student and i am trying to build a hydraulic system for a crane miniature. My hydraulic system has the my defined values but i am getting the error: Error:An error occurred during simulation and the simulation was terminated
Caused by:
[‘test_hydraulics/Solver Configuration1’]: At time 0.498629, one or more assertions are triggered. See causes for specific information.
Liquid volume must be greater than minimum physical volume. The assertion comes from:
Block path: test_hydraulics/Double-Acting Actuator (IL)1
Assert location:
o In between line: 242, column: 5 and line: 242, column: 11 in file: foundation.isothermal_liquid.elements.translational_mechanical_converter
o In between line: 386, column: 17 and line: 395, column: 39 in file: fluids.isothermal_liquid.actuators.double_actuator
I dont know what to do i tried editing the parameters and i noticed that when i change my actuator area paramters from m^2 to cm^2 it works.
Thanks in advance! simscape MATLAB Answers — New Questions
How to link uialert to my App Designer UI figure?
I recently took over a MATLAB project of a former colleague and is still learning how to write MATLAB code correctly. I would like to change working code that currently uses msgbox to now rather make use of uialert(). I can however not find a way to link the UIFigure of my app to the uialert function. My understanding is that the arguments should be as follows: uialert(uifigure,message,title). My problem seems to be with the uifigure argument.
The uialert Help indicates that the uifigure must be created with the uifigure function. When I use the following code I do get a new uifigure and the alert message appears in front of it as expected.
f = uifigure;
uialert(f,’Test’,’warning’);
I do however want the alert message to appear in front of the App Designer UIFigure rather than a newly created figure. I found code here on the forum that identifies the name of my App Designer figure:
hFigs = findall(groot, ‘Type’, ‘figure’)
hFigs = Figure (VTT) with properties:
Number: []
Name: ‘VTT’
I tried several ways to try to refer to the name of my App Designer figure but none of them worked. Below are two examples of what I tried.
uialert(‘VTT’,’Test’,’warning’);
uialert(hFigs.Name,’Test’,’warning’);
I got the following error with both lines of code:
Error using uialert (line 35)
Invalid or deleted figure handle. First argument must be a valid figure handle
I might be using the wrong terminology but I can not find any answers in this forum that explained to me how I can link uialert() to appear in front of the the App Designer UIFigure.I recently took over a MATLAB project of a former colleague and is still learning how to write MATLAB code correctly. I would like to change working code that currently uses msgbox to now rather make use of uialert(). I can however not find a way to link the UIFigure of my app to the uialert function. My understanding is that the arguments should be as follows: uialert(uifigure,message,title). My problem seems to be with the uifigure argument.
The uialert Help indicates that the uifigure must be created with the uifigure function. When I use the following code I do get a new uifigure and the alert message appears in front of it as expected.
f = uifigure;
uialert(f,’Test’,’warning’);
I do however want the alert message to appear in front of the App Designer UIFigure rather than a newly created figure. I found code here on the forum that identifies the name of my App Designer figure:
hFigs = findall(groot, ‘Type’, ‘figure’)
hFigs = Figure (VTT) with properties:
Number: []
Name: ‘VTT’
I tried several ways to try to refer to the name of my App Designer figure but none of them worked. Below are two examples of what I tried.
uialert(‘VTT’,’Test’,’warning’);
uialert(hFigs.Name,’Test’,’warning’);
I got the following error with both lines of code:
Error using uialert (line 35)
Invalid or deleted figure handle. First argument must be a valid figure handle
I might be using the wrong terminology but I can not find any answers in this forum that explained to me how I can link uialert() to appear in front of the the App Designer UIFigure. I recently took over a MATLAB project of a former colleague and is still learning how to write MATLAB code correctly. I would like to change working code that currently uses msgbox to now rather make use of uialert(). I can however not find a way to link the UIFigure of my app to the uialert function. My understanding is that the arguments should be as follows: uialert(uifigure,message,title). My problem seems to be with the uifigure argument.
The uialert Help indicates that the uifigure must be created with the uifigure function. When I use the following code I do get a new uifigure and the alert message appears in front of it as expected.
f = uifigure;
uialert(f,’Test’,’warning’);
I do however want the alert message to appear in front of the App Designer UIFigure rather than a newly created figure. I found code here on the forum that identifies the name of my App Designer figure:
hFigs = findall(groot, ‘Type’, ‘figure’)
hFigs = Figure (VTT) with properties:
Number: []
Name: ‘VTT’
I tried several ways to try to refer to the name of my App Designer figure but none of them worked. Below are two examples of what I tried.
uialert(‘VTT’,’Test’,’warning’);
uialert(hFigs.Name,’Test’,’warning’);
I got the following error with both lines of code:
Error using uialert (line 35)
Invalid or deleted figure handle. First argument must be a valid figure handle
I might be using the wrong terminology but I can not find any answers in this forum that explained to me how I can link uialert() to appear in front of the the App Designer UIFigure. uialert, app designer uifigure MATLAB Answers — New Questions
Spooky Graphed Data?
Data tip doesn’t match Yaxis or actual data. Actual data is 1073741824.
Can anyone explain this?Data tip doesn’t match Yaxis or actual data. Actual data is 1073741824.
Can anyone explain this? Data tip doesn’t match Yaxis or actual data. Actual data is 1073741824.
Can anyone explain this? graph MATLAB Answers — New Questions
Microsoft Issues Updated Guidance for Defender for Office 365 Licensing
Changes to MDO P2 to Remove Requirements to License All Shared Mailboxes
Last August, I wrote about the issue of unexpected costs for Microsoft 365 customers when Microsoft Defender for Office 365 Plan 2 (MDO P2) was enabled in a tenant because MDO P2 is included as a service plan in Office 365/Microsoft 365 E5 licenses. No administrator action is required to use MDO P2; the presence of an E5 license is enough to activate its protection.
According to the MDO service description (August 2025), when MDO P2 is used by a tenant, “licenses must be acquired for users or mailboxes falling under one or more of the following scenarios:
- All Exchange Online users on the tenant. This is because Plan 2 features and capabilities protect all users in the tenant.
- All shared mailboxes on the tenant.”
In other words, the presence of just one E5 license automatically invokes the need for MDO P2 licenses for every Exchange Online user and shared mailbox. Buying MDO P2 at $5/user/month to remain compliant quickly racks up a substantial bill.
Group mailboxes also benefit from MDO P2 protection, but the service description makes no mention of a license requirement for these mailboxes, despite the efforts made by Microsoft over the years to give group mailboxes equivalent functionality to shared mailboxes.
Removing Inconsistency and Incoherence
In short, inconsistencies and incoherence abounded in the MDO P2 licensing requirements. The MDO team agreed to take the issue away to see what could be done to improve matters, and now they’ve come back with a revised licensing scheme.
The big change is the removal of the requirement for MDO P2 licenses for all user and shared mailboxes when E5 licenses are present. The previous position was indefensible and it’s good that Microsoft agreed.
Instead of a “MDO P2 licenses required for all mailboxes” approach, Microsoft uses the “if you benefit from a feature, you pay for a feature” rule that already applied to MDO P1 licensing. The new licensing terms are shown in FIgure 1:

Microsoft Defender for Office 365 P2 can be licensed through any of the following:
“Microsoft Defender for Office 365 Plan 2 standalone, Microsoft 365 E5/A5/G5, Office 365 E5/A5/G5, Microsoft Defender Suite/EDU/GOV/FLW, and Microsoft Defender + Purview Suite FLW provide the rights for a user to benefit from Microsoft Defender for Office 365 Plan 2.”
In other words, tenant administrators must decide which mailboxes should benefit from MDO P2 and then license those mailboxes accordingly. Licensing is automatic for accounts with E5 licenses because the MDO P2 service plan is already present. Shared mailboxes that tenants want to receive MDO protection will need to be licensed.
Custom Policies Required to Scope MDO Coverage
Unless a tenant licenses every user and shared mailbox, the new licensing arrangement means that administrators must create custom scoped policies to enable the MDO P2 safe links, safe attachments, and anti-phishing features for target groups rather than using the scope of the default policy to “cover everyone.” The target group can include user and shared mailboxes.
In large tenants, several custom policies will probably be required to cover different target groups. Dynamic distribution groups aren’t supported for scoped policies, but dynamic Microsoft 365 Groups are. Using dynamic Microsoft 365 Groups creates the requirement for Entra P1 licenses for all users that are members of a dynamic group.
One issue is that the membership rules for dynamic Microsoft 365 Groups don’t offer an off-the-shelf way to find shared mailboxes. Shared mailboxes will need to be marked in some manner such as a value in a custom attribute to allow a membership rule to find and include their accounts in group membership. On the upside, a dynamic Microsoft 365 Group to find shared mailboxes for MDO protection can also assign the MDO P2 license to the mailboxes.
I can see why Microsoft has gone down the path of using custom scoped policies to target the mailboxes to receive MDO protection. It’s a feature that already exists and works, but I’m not sure how much use custom scoped MDO policies get in the real world because I have never used these kinds of policies. I’m also unsure about the amount of administrative effort that will be necessary to set up and maintain the policies, especially in large tenants.
Group Mailboxes Don’t Need MDO Licenses
No mention is made about the group mailboxes used by Microsoft 365 Groups. This might be because Microsoft 365 Groups come about through the creation of other Microsoft 365 objects, like Teams and group-connected SharePoint Online sites. By contrast, creating a shared mailbox is a standalone operation to support the work of a team or to preserve a leaver mailbox, so it could be argued that it would be unfair to insist on licensing the automatic operation. In any case, I suspect that some debate will continue on this point.
Guiding Principles
The new licensing arrangement for MDO P2 can be broken down into four guiding principles:
- MDO licenses are required for any mailbox (or rather, the user account that the mailbox belongs to) that comes within the scope of an MDO policy to enable features like safe link and safe attachments.
- The majority of MDO processing happens during mail flow delivery to mailboxes. If a mailbox comes within the scope of an MDO policy (including a policy covering all mailboxes), it gets the benefit of the MDO features. If the account isn’t within the scope of an MDO policy, it doesn’t.
- When considering the protection of shared mailboxes, only include shared mailboxes that actively receive external email that require protection. Exclude shared mailboxes like those used to retain leaver data (use inactive mailboxes instead), defunct mailboxes (consider their removal), and mailboxes used exclusively to process internal email.
- MDO licenses don’t need to be assigned to the accounts that own shared mailboxes. All Microsoft requires is that the tenant has sufficient MDO licenses to cover the user and shared mailboxes that come within the scope of MDO policies.
- Accounts that benefit from MDO P2 features must be licensed for those features.
The new MDO licensing arrangement is better, but it requires more thought and action from tenant administrators, especially to configure and maintain policies to make MDO P2 features available to user accounts.
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
Trying to start Obstacle Avoidance in NVIDIA Jetson with PX4 Autopilot in Hardware-in-the-Loop (HITL) Simulation with UAV Dynamics Modeled in Simulink
Hello, I ran into two problems when working with QGroundControl (QGC), Pixhawk and Jetson as a mission computer. QGC issues the error "Unable to start mission: Vehicle not changing to Mission flight mode". At the same time, the mission is loaded into autopilot, there is a connection between QGC and Pixhawk.
Obstacle Avoidance: The model in Simulink works, but the video viewer does not receive depth frames from Jetson.
In the Jetson log:
[sudo] password for superadmin: No protocol specified
nvbuf_utils: Couild not get EGL display connection
Opening in blocking MODE
State change is async
**starting the model**
I checked the connection beetween Host PC(192.168.1202) and Jetson(192.168.1.201) via wireshark
QGround also see mission computer
In simulink Obstacle Avoidance Model a have such warnings
What could be the cause of the error changing the flight mode to "Mission"? Could it be caused by issues on the Jetson side or in the Simulink model? How can I fix the "Could not get EGL display connection" error on the Jetson so that the obstacle avoidance model can transmit depth frames?Hello, I ran into two problems when working with QGroundControl (QGC), Pixhawk and Jetson as a mission computer. QGC issues the error "Unable to start mission: Vehicle not changing to Mission flight mode". At the same time, the mission is loaded into autopilot, there is a connection between QGC and Pixhawk.
Obstacle Avoidance: The model in Simulink works, but the video viewer does not receive depth frames from Jetson.
In the Jetson log:
[sudo] password for superadmin: No protocol specified
nvbuf_utils: Couild not get EGL display connection
Opening in blocking MODE
State change is async
**starting the model**
I checked the connection beetween Host PC(192.168.1202) and Jetson(192.168.1.201) via wireshark
QGround also see mission computer
In simulink Obstacle Avoidance Model a have such warnings
What could be the cause of the error changing the flight mode to "Mission"? Could it be caused by issues on the Jetson side or in the Simulink model? How can I fix the "Could not get EGL display connection" error on the Jetson so that the obstacle avoidance model can transmit depth frames? Hello, I ran into two problems when working with QGroundControl (QGC), Pixhawk and Jetson as a mission computer. QGC issues the error "Unable to start mission: Vehicle not changing to Mission flight mode". At the same time, the mission is loaded into autopilot, there is a connection between QGC and Pixhawk.
Obstacle Avoidance: The model in Simulink works, but the video viewer does not receive depth frames from Jetson.
In the Jetson log:
[sudo] password for superadmin: No protocol specified
nvbuf_utils: Couild not get EGL display connection
Opening in blocking MODE
State change is async
**starting the model**
I checked the connection beetween Host PC(192.168.1202) and Jetson(192.168.1.201) via wireshark
QGround also see mission computer
In simulink Obstacle Avoidance Model a have such warnings
What could be the cause of the error changing the flight mode to "Mission"? Could it be caused by issues on the Jetson side or in the Simulink model? How can I fix the "Could not get EGL display connection" error on the Jetson so that the obstacle avoidance model can transmit depth frames? jetson, px4, hitl, qgroundcontrol, cube orange plus MATLAB Answers — New Questions
C2000 CAN Video example calls out eCAN, but blockset shows CAN and we have an RX Issue
We are using two 379D launchpads. The TX section works fine.
The RX, when we connect the two boards, the bus stops as if the RX model is not configured correctly. We checked everything.
Is there a known good example of this we can use to get started ?We are using two 379D launchpads. The TX section works fine.
The RX, when we connect the two boards, the bus stops as if the RX model is not configured correctly. We checked everything.
Is there a known good example of this we can use to get started ? We are using two 379D launchpads. The TX section works fine.
The RX, when we connect the two boards, the bus stops as if the RX model is not configured correctly. We checked everything.
Is there a known good example of this we can use to get started ? c2000 can example issue MATLAB Answers — New Questions
Why am I getting a near 0 current in the flyback converter?
Hi,
I am simulating this flyback converter where Vin is 48 V, Vout should be 380 V, the mutual inductance has L1 = 1e-5 H, L2 = 0.036 H, VF in the diode is 2.1 V and C = 87e-6 F. As you can see in the diagram, I tried to control it first by close-loop but as I couldn’t get the right values, I tried by fixing a constant which is 0.116564 which is the calculated duty cycle for Vin= 48 V. The problem I get is the values of V_out which is -1.428 V and I_out near 0 but negative. I tried moving the current measurement block to the bottom and the top branch, changing the connection with the secondary inductance or the polarity in the voltage measurement. I never get positive voltage and positive current with high values. According to my calculations, I_out should be 2.53 A and V_out, as I said 380 V. Could someone with knowledge in power electronics and simulink help me with this issue? It’s R2022b version.
Thanks.
CarlosHi,
I am simulating this flyback converter where Vin is 48 V, Vout should be 380 V, the mutual inductance has L1 = 1e-5 H, L2 = 0.036 H, VF in the diode is 2.1 V and C = 87e-6 F. As you can see in the diagram, I tried to control it first by close-loop but as I couldn’t get the right values, I tried by fixing a constant which is 0.116564 which is the calculated duty cycle for Vin= 48 V. The problem I get is the values of V_out which is -1.428 V and I_out near 0 but negative. I tried moving the current measurement block to the bottom and the top branch, changing the connection with the secondary inductance or the polarity in the voltage measurement. I never get positive voltage and positive current with high values. According to my calculations, I_out should be 2.53 A and V_out, as I said 380 V. Could someone with knowledge in power electronics and simulink help me with this issue? It’s R2022b version.
Thanks.
Carlos Hi,
I am simulating this flyback converter where Vin is 48 V, Vout should be 380 V, the mutual inductance has L1 = 1e-5 H, L2 = 0.036 H, VF in the diode is 2.1 V and C = 87e-6 F. As you can see in the diagram, I tried to control it first by close-loop but as I couldn’t get the right values, I tried by fixing a constant which is 0.116564 which is the calculated duty cycle for Vin= 48 V. The problem I get is the values of V_out which is -1.428 V and I_out near 0 but negative. I tried moving the current measurement block to the bottom and the top branch, changing the connection with the secondary inductance or the polarity in the voltage measurement. I never get positive voltage and positive current with high values. According to my calculations, I_out should be 2.53 A and V_out, as I said 380 V. Could someone with knowledge in power electronics and simulink help me with this issue? It’s R2022b version.
Thanks.
Carlos flyback converter, power_electronics_control, power_conversion_control, simpowersystems, simulink MATLAB Answers — New Questions
Contact angle in a video of a sessile droplet
Hey all
Okay so i have this script to analyze videos of single droplets drying now i want to calculate the contact angles using the script i made which is also attachted but the method i am using now results in results that are not consistent and jaggery so do any of you have suggestions on how to improve the contact angle determination, i think it could also have something to do with how we binarize and determine the edge of the droplet? normally the script processes videos of around 30s at 100 fps but i couldnt attach that so here is a very short sample video. here is the code that calculates the contact angle
%binary image creation
backgroundDiff = abs(double(grayFrame) – averageBackground);
% threshold
binaryImage = backgroundDiff > backgroundThreshold;
% morphological operations to preserve droplet
cleanedImage = imopen(binaryImage, strel(‘disk’, morphOpenDiskSize));
cleanedImage = imclose(cleanedImage, strel(‘disk’, morphCloseDiskSize));
filledImage = imfill(cleanedImage, ‘holes’);
dropletOutsideSurface = filledImage & ~surfaceMask_logical;
dropletAll = filledImage;
% Find droplet boundary
dropletBoundary = bwboundaries(dropletMask);
if ~isempty(dropletBoundary)
outline = dropletBoundary{1};
x_outline = outline(:,2); % Column indices (x-coordinates)
y_outline = outline(:,1); % Row indices (y-coordinates)
if numel(x_outline) >= 20 % Need sufficient points
% Convert to physical coordinates (meters)
x_phys = x_outline * scale_Image * 1e-6;
y_phys = y_outline * scale_Image * 1e-6;
% Find contact points (points near the surface)
surface_y_phys = minYSurface * scale_Image * 1e-6;
contact_threshold = equiv_radius * 0.3; % 30% of droplet radius
% Find all points near the surface
near_surface_indices = find(abs(y_phys – surface_y_phys) < contact_threshold);
if length(near_surface_indices) >= 4
% Find the leftmost and rightmost contact points
x_contact = x_phys(near_surface_indices);
y_contact = y_phys(near_surface_indices);
[x_min, left_idx] = min(x_contact);
[x_max, right_idx] = max(x_contact);
left_contact_point = [x_min, y_contact(left_idx)];
right_contact_point = [x_max, y_contact(right_idx)];
% ADVANCED: Calculate contact angles using tangent method (from original)
tangent_range = equiv_radius * 0.2; % Distance for tangent calculation
% LEFT CONTACT ANGLE
left_contact_idx = near_surface_indices(left_idx);
distances_from_left = sqrt((x_phys – left_contact_point(1)).^2 + …
(y_phys – left_contact_point(2)).^2);
tangent_indices_left = find(distances_from_left <= tangent_range & …
distances_from_left > 0);
if length(tangent_indices_left) >= 3
above_contact = tangent_indices_left(y_phys(tangent_indices_left) < left_contact_point(2));
if length(above_contact) >= 3
x_fit = x_phys(above_contact);
y_fit = y_phys(above_contact);
[x_fit, sort_idx] = sort(x_fit);
y_fit = y_fit(sort_idx);
if length(unique(x_fit)) >= 2 && length(x_fit) >= 2
try
p_left = polyfit(x_fit, y_fit, 1);
slope_left = p_left(1);
catch
slope_left = NaN;
end
else
slope_left = NaN;
end
if ~isnan(slope_left)
angle_rad_left = atan(slope_left);
contact_angle_left = 180 – rad2deg(angle_rad_left);
if contact_angle_left < 0
contact_angle_left = contact_angle_left + 180;
elseif contact_angle_left > 180
contact_angle_left = contact_angle_left – 180;
end
end
end
end
% RIGHT CONTACT ANGLE (similar process)
right_contact_idx = near_surface_indices(right_idx);
distances_from_right = sqrt((x_phys – right_contact_point(1)).^2 + …
(y_phys – right_contact_point(2)).^2);
tangent_indices_right = find(distances_from_right <= tangent_range & …
distances_from_right > 0);
if length(tangent_indices_right) >= 3
above_contact = tangent_indices_right(y_phys(tangent_indices_right) < right_contact_point(2));
if length(above_contact) >= 3
x_fit = x_phys(above_contact);
y_fit = y_phys(above_contact);
[x_fit, sort_idx] = sort(x_fit);
y_fit = y_fit(sort_idx);
if length(unique(x_fit)) >= 2 && length(x_fit) >= 2
try
p_right = polyfit(x_fit, y_fit, 1);
slope_right = p_right(1);
catch
slope_right = NaN;
end
else
slope_right = NaN;
end
if ~isnan(slope_right)
angle_rad_right = atan(slope_right);
contact_angle_right = rad2deg(angle_rad_right);
if contact_angle_right < 0
contact_angle_right = contact_angle_right + 180;
elseif contact_angle_right > 180
contact_angle_right = contact_angle_right – 180;
end
end
end
end
% Calculate average contact angle
if ~isnan(contact_angle_left) && ~isnan(contact_angle_right)
contact_angle_avg = (contact_angle_left + contact_angle_right) / 2;
elseif ~isnan(contact_angle_left)
contact_angle_avg = contact_angle_left;
elseif ~isnan(contact_angle_right)
contact_angle_avg = contact_angle_right;
end
end
end
endHey all
Okay so i have this script to analyze videos of single droplets drying now i want to calculate the contact angles using the script i made which is also attachted but the method i am using now results in results that are not consistent and jaggery so do any of you have suggestions on how to improve the contact angle determination, i think it could also have something to do with how we binarize and determine the edge of the droplet? normally the script processes videos of around 30s at 100 fps but i couldnt attach that so here is a very short sample video. here is the code that calculates the contact angle
%binary image creation
backgroundDiff = abs(double(grayFrame) – averageBackground);
% threshold
binaryImage = backgroundDiff > backgroundThreshold;
% morphological operations to preserve droplet
cleanedImage = imopen(binaryImage, strel(‘disk’, morphOpenDiskSize));
cleanedImage = imclose(cleanedImage, strel(‘disk’, morphCloseDiskSize));
filledImage = imfill(cleanedImage, ‘holes’);
dropletOutsideSurface = filledImage & ~surfaceMask_logical;
dropletAll = filledImage;
% Find droplet boundary
dropletBoundary = bwboundaries(dropletMask);
if ~isempty(dropletBoundary)
outline = dropletBoundary{1};
x_outline = outline(:,2); % Column indices (x-coordinates)
y_outline = outline(:,1); % Row indices (y-coordinates)
if numel(x_outline) >= 20 % Need sufficient points
% Convert to physical coordinates (meters)
x_phys = x_outline * scale_Image * 1e-6;
y_phys = y_outline * scale_Image * 1e-6;
% Find contact points (points near the surface)
surface_y_phys = minYSurface * scale_Image * 1e-6;
contact_threshold = equiv_radius * 0.3; % 30% of droplet radius
% Find all points near the surface
near_surface_indices = find(abs(y_phys – surface_y_phys) < contact_threshold);
if length(near_surface_indices) >= 4
% Find the leftmost and rightmost contact points
x_contact = x_phys(near_surface_indices);
y_contact = y_phys(near_surface_indices);
[x_min, left_idx] = min(x_contact);
[x_max, right_idx] = max(x_contact);
left_contact_point = [x_min, y_contact(left_idx)];
right_contact_point = [x_max, y_contact(right_idx)];
% ADVANCED: Calculate contact angles using tangent method (from original)
tangent_range = equiv_radius * 0.2; % Distance for tangent calculation
% LEFT CONTACT ANGLE
left_contact_idx = near_surface_indices(left_idx);
distances_from_left = sqrt((x_phys – left_contact_point(1)).^2 + …
(y_phys – left_contact_point(2)).^2);
tangent_indices_left = find(distances_from_left <= tangent_range & …
distances_from_left > 0);
if length(tangent_indices_left) >= 3
above_contact = tangent_indices_left(y_phys(tangent_indices_left) < left_contact_point(2));
if length(above_contact) >= 3
x_fit = x_phys(above_contact);
y_fit = y_phys(above_contact);
[x_fit, sort_idx] = sort(x_fit);
y_fit = y_fit(sort_idx);
if length(unique(x_fit)) >= 2 && length(x_fit) >= 2
try
p_left = polyfit(x_fit, y_fit, 1);
slope_left = p_left(1);
catch
slope_left = NaN;
end
else
slope_left = NaN;
end
if ~isnan(slope_left)
angle_rad_left = atan(slope_left);
contact_angle_left = 180 – rad2deg(angle_rad_left);
if contact_angle_left < 0
contact_angle_left = contact_angle_left + 180;
elseif contact_angle_left > 180
contact_angle_left = contact_angle_left – 180;
end
end
end
end
% RIGHT CONTACT ANGLE (similar process)
right_contact_idx = near_surface_indices(right_idx);
distances_from_right = sqrt((x_phys – right_contact_point(1)).^2 + …
(y_phys – right_contact_point(2)).^2);
tangent_indices_right = find(distances_from_right <= tangent_range & …
distances_from_right > 0);
if length(tangent_indices_right) >= 3
above_contact = tangent_indices_right(y_phys(tangent_indices_right) < right_contact_point(2));
if length(above_contact) >= 3
x_fit = x_phys(above_contact);
y_fit = y_phys(above_contact);
[x_fit, sort_idx] = sort(x_fit);
y_fit = y_fit(sort_idx);
if length(unique(x_fit)) >= 2 && length(x_fit) >= 2
try
p_right = polyfit(x_fit, y_fit, 1);
slope_right = p_right(1);
catch
slope_right = NaN;
end
else
slope_right = NaN;
end
if ~isnan(slope_right)
angle_rad_right = atan(slope_right);
contact_angle_right = rad2deg(angle_rad_right);
if contact_angle_right < 0
contact_angle_right = contact_angle_right + 180;
elseif contact_angle_right > 180
contact_angle_right = contact_angle_right – 180;
end
end
end
end
% Calculate average contact angle
if ~isnan(contact_angle_left) && ~isnan(contact_angle_right)
contact_angle_avg = (contact_angle_left + contact_angle_right) / 2;
elseif ~isnan(contact_angle_left)
contact_angle_avg = contact_angle_left;
elseif ~isnan(contact_angle_right)
contact_angle_avg = contact_angle_right;
end
end
end
end Hey all
Okay so i have this script to analyze videos of single droplets drying now i want to calculate the contact angles using the script i made which is also attachted but the method i am using now results in results that are not consistent and jaggery so do any of you have suggestions on how to improve the contact angle determination, i think it could also have something to do with how we binarize and determine the edge of the droplet? normally the script processes videos of around 30s at 100 fps but i couldnt attach that so here is a very short sample video. here is the code that calculates the contact angle
%binary image creation
backgroundDiff = abs(double(grayFrame) – averageBackground);
% threshold
binaryImage = backgroundDiff > backgroundThreshold;
% morphological operations to preserve droplet
cleanedImage = imopen(binaryImage, strel(‘disk’, morphOpenDiskSize));
cleanedImage = imclose(cleanedImage, strel(‘disk’, morphCloseDiskSize));
filledImage = imfill(cleanedImage, ‘holes’);
dropletOutsideSurface = filledImage & ~surfaceMask_logical;
dropletAll = filledImage;
% Find droplet boundary
dropletBoundary = bwboundaries(dropletMask);
if ~isempty(dropletBoundary)
outline = dropletBoundary{1};
x_outline = outline(:,2); % Column indices (x-coordinates)
y_outline = outline(:,1); % Row indices (y-coordinates)
if numel(x_outline) >= 20 % Need sufficient points
% Convert to physical coordinates (meters)
x_phys = x_outline * scale_Image * 1e-6;
y_phys = y_outline * scale_Image * 1e-6;
% Find contact points (points near the surface)
surface_y_phys = minYSurface * scale_Image * 1e-6;
contact_threshold = equiv_radius * 0.3; % 30% of droplet radius
% Find all points near the surface
near_surface_indices = find(abs(y_phys – surface_y_phys) < contact_threshold);
if length(near_surface_indices) >= 4
% Find the leftmost and rightmost contact points
x_contact = x_phys(near_surface_indices);
y_contact = y_phys(near_surface_indices);
[x_min, left_idx] = min(x_contact);
[x_max, right_idx] = max(x_contact);
left_contact_point = [x_min, y_contact(left_idx)];
right_contact_point = [x_max, y_contact(right_idx)];
% ADVANCED: Calculate contact angles using tangent method (from original)
tangent_range = equiv_radius * 0.2; % Distance for tangent calculation
% LEFT CONTACT ANGLE
left_contact_idx = near_surface_indices(left_idx);
distances_from_left = sqrt((x_phys – left_contact_point(1)).^2 + …
(y_phys – left_contact_point(2)).^2);
tangent_indices_left = find(distances_from_left <= tangent_range & …
distances_from_left > 0);
if length(tangent_indices_left) >= 3
above_contact = tangent_indices_left(y_phys(tangent_indices_left) < left_contact_point(2));
if length(above_contact) >= 3
x_fit = x_phys(above_contact);
y_fit = y_phys(above_contact);
[x_fit, sort_idx] = sort(x_fit);
y_fit = y_fit(sort_idx);
if length(unique(x_fit)) >= 2 && length(x_fit) >= 2
try
p_left = polyfit(x_fit, y_fit, 1);
slope_left = p_left(1);
catch
slope_left = NaN;
end
else
slope_left = NaN;
end
if ~isnan(slope_left)
angle_rad_left = atan(slope_left);
contact_angle_left = 180 – rad2deg(angle_rad_left);
if contact_angle_left < 0
contact_angle_left = contact_angle_left + 180;
elseif contact_angle_left > 180
contact_angle_left = contact_angle_left – 180;
end
end
end
end
% RIGHT CONTACT ANGLE (similar process)
right_contact_idx = near_surface_indices(right_idx);
distances_from_right = sqrt((x_phys – right_contact_point(1)).^2 + …
(y_phys – right_contact_point(2)).^2);
tangent_indices_right = find(distances_from_right <= tangent_range & …
distances_from_right > 0);
if length(tangent_indices_right) >= 3
above_contact = tangent_indices_right(y_phys(tangent_indices_right) < right_contact_point(2));
if length(above_contact) >= 3
x_fit = x_phys(above_contact);
y_fit = y_phys(above_contact);
[x_fit, sort_idx] = sort(x_fit);
y_fit = y_fit(sort_idx);
if length(unique(x_fit)) >= 2 && length(x_fit) >= 2
try
p_right = polyfit(x_fit, y_fit, 1);
slope_right = p_right(1);
catch
slope_right = NaN;
end
else
slope_right = NaN;
end
if ~isnan(slope_right)
angle_rad_right = atan(slope_right);
contact_angle_right = rad2deg(angle_rad_right);
if contact_angle_right < 0
contact_angle_right = contact_angle_right + 180;
elseif contact_angle_right > 180
contact_angle_right = contact_angle_right – 180;
end
end
end
end
% Calculate average contact angle
if ~isnan(contact_angle_left) && ~isnan(contact_angle_right)
contact_angle_avg = (contact_angle_left + contact_angle_right) / 2;
elseif ~isnan(contact_angle_left)
contact_angle_avg = contact_angle_left;
elseif ~isnan(contact_angle_right)
contact_angle_avg = contact_angle_right;
end
end
end
end image processing, image analysis MATLAB Answers — New Questions
Possible bug in coneprog.m function
I am running a trajectory optimisation problem.
The formulation is convexified via slack variables and linearisation and I was testing coneprog as solver.
I noticed some issues with the function that I would like to report and verify if it is my mistake or a bug.
My code is completely deterministic. There is no randomisation and the execution should be 100% reproducible.
Nevertheless, running the same code multiple times with the same input and options leads to different results.
Unlinke fmincon, with coneprog it is impossible to access internal calculation and to understand what is going on, therefore I do not have many insights.
My guess is that a random noise is applied to the initial guess.
In theory this should not be a problem since a convex problem has only one minimum.
In practice, the solver sometimes finds an optimal solution and other times declares the problem unfeasible.
I can solve the same exact problem with an NLP formulation using fmincon, so I know for sure the proble is solvable.
I tried to change the initial conditions and the problem persists.
Sometimes, different minima are found in different calls of the solver.
This is not due to the presence of a flat in the solution space because the fval differ by 1 to 2 orders of magnitude.
Another issue I am having is connected to the iterative procedure I have implemented.
At first I obtain an anlytical initial guess that is numerically propagated.
The constraints are linearised around this reference trajectory and the coneprog is called to solve the problem.
Once the optimal control is obtained, the solution is again propagated and if the error is not below the specified tolerance the process is repeated iteratively.
For some initial conditions the solver works smoothly, but for other it stops at the 5-th or 6-th iteration (declaring the problem unfeasible) when it is really close to the finalise the solution.
Again, it is important to highlight that I am 100% confident that the problem is feasible.
It is important to highlight that some degree of reproducibility is still present.
Even if the solver behaves differently, the number of possible behaviours is limited to just a few outcomes, depending on the initial conditions.
In general, for every problem there are 2 or 3 possible outcomes.
Moreover, some outcomes may occur more frequently than others.
I have spent days trying to find the issue in my code, but now, after testing with fmincon, I am starting to be confident that the problem is in coneprog.
I have also noticed that the solver behaves differently depending on the optimalityTolerance.
This was later confirmed when I found out that the problem has already been reported on this forum here.
An other bug I noticed in some solutions is that both Primal and Dual Feasibility report a value, but if I check manually the constraint satisfaction, the feasibility is off by several order of magnitudes.
I am 100% confident that the check I performed is correct because it was performed with a breakpoint placed right after the call to coneprog as shown below.
I have also stored the inputs of coneprog right before the function was called.
In my opinion, if the problem is coneprog as I think it is, the bug is related to the update step of the current guess.
Have you experienced similar problem with coneprog, or are you aware of some limitations it may have?
Did you already encountered such problem and understood where it is coming from?
The main motivations why I think coneprog is the problem are the different outputs produced from a deterministic code, and the fact that, when the problem converges, the solution is correct.
As a final comment, I think it would be really useful to have the freedom of specifying an initial guess.
If I know already a solution that is both an interior point and very close to the optimal one, this would cut down considerably the computational time.
—————————————————————————————————————————-
Below you can find an example of the solver converging to an unfeasible point after some iterations.
The target value of poc is 1e-10.
The formulation of the optimsiation problem is based on a direct transcription to discretise a continuous trajectory into discrete nodes.
The solution vector x is built as:
x = [ux1 uy1 uz1 u1 … uxN uyN uzN uN b1 b2]
where:
[uxi uyi uzi] is the control vector at the i-th node.
ui is the magnitude of the control vector at the i-th node.
[b1 b2] are some end conditions that must satisfy a linear constraint
The only cone constraints present are the one that impose:
sqrt(uxi^2 + uyi^2 + uzi^2) <= 1
sqrt(uxi^2 + uyi^2 + uzi^2) <= ui
The linear objective function minimises the control effort defined as:
In the example below, the trajectory is discretised into 852 nodes.
This is clear from the initial Fval of every iteration that corresponds to the number of nodes, as the initial guess is probably all ones.
The last call of coneprog declares the problem unfeasible and it is the only iteration where Fval increases after the initial guess.
The problem with the constraint satisfication can be understood from the values of the Infeasibilities.
To help the problem converges I defined a lower bound to uxi, uyi, and uzi of -1, and a lower bound to ui of 0.
Similarly, I defined an upper bound to uxi, uyi, uzi, and ui of 1.
An Fval of 1.118894e+03 in the last line of the example below, clearly goes against the upper bound constraint, as the maximum value of Fval allowed by the upper bound is 852.
Instead the sovler is analysing a solution with Fval of approximately 1119, but it thinks that the constraints are satisfied, which is impossible.
Maybe my interpretation of Primal and Dual Feasibility is wrong, but my intuition is suggesting me that coneprog may have some problems.
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.351509e-01 2.500000e-01 8.338790e-02 0.43
1 2.903535e+02 5.653968e-02 4.217479e-02 1.406747e-02 0.46
2 5.760140e+01 1.155766e-02 8.621236e-03 2.875627e-03 0.50
3 1.826360e+01 3.567321e-03 2.660981e-03 8.875744e-04 0.54
4 1.587390e+01 2.115580e-03 1.578080e-03 5.263711e-04 0.58
5 1.496351e+01 1.979895e-03 1.476868e-03 4.926117e-04 0.61
6 1.477297e+01 1.930240e-03 1.439829e-03 4.802573e-04 0.65
7 1.407791e+01 1.740965e-03 1.298643e-03 4.331644e-04 0.69
8 1.195150e+01 1.139652e-03 8.501032e-04 2.835533e-04 0.73
9 1.118074e+01 9.249616e-04 6.899590e-04 2.301369e-04 0.76
10 9.263514e+00 3.932808e-04 2.933610e-04 9.785102e-05 0.80
11 8.435984e+00 1.662211e-04 1.239898e-04 4.135699e-05 0.84
12 8.137082e+00 8.259246e-05 6.160841e-05 2.054958e-05 0.89
13 7.834045e+00 4.811473e-06 3.589036e-06 1.197128e-06 0.93
14 7.817072e+00 4.211285e-07 3.141435e-07 1.047797e-07 0.97
15 7.815469e+00 1.297491e-08 9.741467e-09 3.228250e-09 1.02
16 7.815429e+00 2.773558e-09 3.724366e-09 6.900807e-10 1.05
Optimal solution found.
poc =
4.7669e-05
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 4.148309e-01 2.500000e-01 8.339003e-02 0.24
1 2.936365e+02 7.220152e-02 4.351262e-02 1.451408e-02 0.28
2 3.227398e+01 9.133979e-03 5.504640e-03 1.836128e-03 0.32
3 2.999204e+01 5.626122e-03 3.390612e-03 1.130973e-03 0.36
4 2.891739e+01 5.422358e-03 3.267812e-03 1.090012e-03 0.40
5 2.734221e+01 4.962369e-03 2.990597e-03 9.975440e-04 0.44
6 2.355320e+01 3.776002e-03 2.275627e-03 7.590585e-04 0.48
7 1.765904e+01 1.858229e-03 1.119871e-03 3.735444e-04 0.53
8 1.493406e+01 9.914144e-04 5.974810e-04 1.992958e-04 0.57
9 1.321215e+01 4.284890e-04 2.582311e-04 8.613560e-05 0.61
10 1.247209e+01 1.862607e-04 1.122510e-04 3.744245e-05 0.65
11 1.203916e+01 4.726695e-05 2.848568e-05 9.501685e-06 0.68
12 1.190390e+01 4.898257e-06 2.951962e-06 9.846561e-07 0.73
13 1.188906e+01 1.900382e-07 1.145391e-07 3.820181e-08 0.77
14 1.188847e+01 9.042867e-09 5.942560e-09 1.817813e-09 0.81
Optimal solution found.
poc =
1.7472e-08
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.740554e-01 2.500000e-01 8.338857e-02 0.23
1 2.549188e+02 4.172979e-02 2.789011e-02 9.302867e-03 0.26
2 9.392526e+01 1.561744e-02 1.043792e-02 3.481612e-03 0.30
3 2.667086e+01 4.410425e-03 2.947708e-03 9.832206e-04 0.34
4 2.407913e+01 2.549053e-03 1.703660e-03 5.682632e-04 0.39
5 2.355160e+01 2.499060e-03 1.670247e-03 5.571180e-04 0.43
6 2.324912e+01 2.449195e-03 1.636919e-03 5.460015e-04 0.47
7 2.249923e+01 2.308274e-03 1.542735e-03 5.145858e-04 0.50
8 2.040632e+01 1.851989e-03 1.237777e-03 4.128657e-04 0.54
9 1.970151e+01 1.692941e-03 1.131477e-03 3.774090e-04 0.59
10 1.744126e+01 1.126199e-03 7.526951e-04 2.510647e-04 0.62
11 1.620420e+01 8.023922e-04 5.362790e-04 1.788781e-04 0.66
12 1.474391e+01 3.945190e-04 2.636768e-04 8.795053e-05 0.70
13 1.427557e+01 2.644519e-04 1.767465e-04 5.895455e-05 0.73
14 1.370019e+01 1.011430e-04 6.759892e-05 2.254791e-05 0.77
15 1.348178e+01 3.984925e-05 2.663325e-05 8.883635e-06 0.81
16 1.336507e+01 7.537767e-06 5.037870e-06 1.680402e-06 0.85
17 1.334002e+01 6.477134e-07 4.329037e-07 1.443954e-07 0.88
18 1.333772e+01 1.179424e-08 7.999240e-09 2.629302e-09 0.93
19 1.333768e+01 1.381986e-10 8.290199e-09 3.080877e-11 0.99
Optimal solution found.
poc =
5.3035e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.472650e-01 2.500000e-01 8.338749e-02 0.23
1 2.309201e+02 2.520373e-02 1.814445e-02 6.052081e-03 0.27
2 9.405942e+01 1.047608e-02 7.541850e-03 2.515584e-03 0.31
3 2.721726e+01 3.116075e-03 2.243298e-03 7.482520e-04 0.35
4 2.416710e+01 1.805118e-03 1.299525e-03 4.334564e-04 0.40
5 2.375956e+01 1.781739e-03 1.282694e-03 4.278426e-04 0.43
6 2.358202e+01 1.764206e-03 1.270072e-03 4.236324e-04 0.47
7 2.304355e+01 1.703461e-03 1.226341e-03 4.090461e-04 0.52
8 2.181656e+01 1.527846e-03 1.099914e-03 3.668761e-04 0.56
9 2.124914e+01 1.448597e-03 1.042861e-03 3.478463e-04 0.60
10 1.948615e+01 1.170737e-03 8.428266e-04 2.811248e-04 0.64
11 1.783054e+01 8.717316e-04 6.275695e-04 2.093258e-04 0.68
12 1.708765e+01 7.336925e-04 5.281936e-04 1.761789e-04 0.72
13 1.550449e+01 3.894897e-04 2.803981e-04 9.352676e-05 0.76
14 1.514484e+01 3.155406e-04 2.271613e-04 7.576962e-05 0.80
15 1.441642e+01 1.496860e-04 1.077607e-04 3.594357e-05 0.85
16 1.411738e+01 7.908921e-05 5.693722e-05 1.899141e-05 0.90
17 1.383348e+01 1.063875e-05 7.658959e-06 2.554645e-06 0.95
18 1.380209e+01 2.769706e-06 1.993947e-06 6.650794e-07 0.99
19 1.379178e+01 1.701668e-07 1.225354e-07 4.086155e-08 1.03
20 1.379114e+01 8.779631e-09 6.671732e-09 2.108221e-09 1.07
Optimal solution found.
poc =
1.8216e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.384156e-01 2.500000e-01 8.338731e-02 0.24
1 2.283493e+02 2.314639e-02 1.709909e-02 5.703387e-03 0.29
2 9.475565e+01 9.793019e-03 7.234463e-03 2.413050e-03 0.33
3 2.755188e+01 2.925713e-03 2.161331e-03 7.209104e-04 0.37
4 2.438422e+01 1.697792e-03 1.254221e-03 4.183445e-04 0.41
5 2.398865e+01 1.677057e-03 1.238903e-03 4.132353e-04 0.45
6 2.383017e+01 1.662889e-03 1.228437e-03 4.097444e-04 0.49
7 2.333142e+01 1.612151e-03 1.190955e-03 3.972422e-04 0.53
8 2.217540e+01 1.460099e-03 1.078629e-03 3.597758e-04 0.56
9 2.173362e+01 1.404707e-03 1.037709e-03 3.461270e-04 0.61
10 2.035602e+01 1.210646e-03 8.943487e-04 2.983093e-04 0.65
11 1.865148e+01 9.312689e-04 6.879625e-04 2.294694e-04 0.68
12 1.727485e+01 7.016610e-04 5.183427e-04 1.728928e-04 0.72
13 1.622825e+01 5.067634e-04 3.743647e-04 1.248691e-04 0.76
14 1.539423e+01 3.289696e-04 2.430219e-04 8.105977e-05 0.80
15 1.498430e+01 2.416941e-04 1.785483e-04 5.955466e-05 0.83
16 1.446995e+01 1.222391e-04 9.030248e-05 3.012032e-05 0.87
17 1.418069e+01 5.599477e-05 4.136539e-05 1.379739e-05 0.91
18 1.397083e+01 5.693174e-06 4.205758e-06 1.402827e-06 0.95
19 1.394958e+01 5.174181e-07 3.822538e-07 1.274944e-07 0.99
20 1.394766e+01 4.663196e-08 3.460641e-08 1.149035e-08 1.03
21 1.394748e+01 2.032849e-09 2.212183e-09 5.009042e-10 1.07
Optimal solution found.
poc =
1.0958e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.341137e-01 2.500000e-01 8.338698e-02 0.24
1 9.059917e+02 1.639868e-01 1.227028e-01 4.092728e-02 0.28
2 1.017406e+03 7.906474e-02 5.916006e-02 1.973271e-02 0.31
3 1.124331e+03 4.121461e-03 3.083876e-03 1.028620e-03 0.35
4 1.118894e+03 6.591392e-06 4.931998e-06 1.645058e-06 0.39
5 1.118894e+03 9.882157e-09 7.394312e-09 2.466356e-09 0.43
6 1.118894e+03 1.481584e-11 1.109217e-11 3.698267e-12 0.46
Problem is infeasible.
This was tested on R2025a and R2023a.I am running a trajectory optimisation problem.
The formulation is convexified via slack variables and linearisation and I was testing coneprog as solver.
I noticed some issues with the function that I would like to report and verify if it is my mistake or a bug.
My code is completely deterministic. There is no randomisation and the execution should be 100% reproducible.
Nevertheless, running the same code multiple times with the same input and options leads to different results.
Unlinke fmincon, with coneprog it is impossible to access internal calculation and to understand what is going on, therefore I do not have many insights.
My guess is that a random noise is applied to the initial guess.
In theory this should not be a problem since a convex problem has only one minimum.
In practice, the solver sometimes finds an optimal solution and other times declares the problem unfeasible.
I can solve the same exact problem with an NLP formulation using fmincon, so I know for sure the proble is solvable.
I tried to change the initial conditions and the problem persists.
Sometimes, different minima are found in different calls of the solver.
This is not due to the presence of a flat in the solution space because the fval differ by 1 to 2 orders of magnitude.
Another issue I am having is connected to the iterative procedure I have implemented.
At first I obtain an anlytical initial guess that is numerically propagated.
The constraints are linearised around this reference trajectory and the coneprog is called to solve the problem.
Once the optimal control is obtained, the solution is again propagated and if the error is not below the specified tolerance the process is repeated iteratively.
For some initial conditions the solver works smoothly, but for other it stops at the 5-th or 6-th iteration (declaring the problem unfeasible) when it is really close to the finalise the solution.
Again, it is important to highlight that I am 100% confident that the problem is feasible.
It is important to highlight that some degree of reproducibility is still present.
Even if the solver behaves differently, the number of possible behaviours is limited to just a few outcomes, depending on the initial conditions.
In general, for every problem there are 2 or 3 possible outcomes.
Moreover, some outcomes may occur more frequently than others.
I have spent days trying to find the issue in my code, but now, after testing with fmincon, I am starting to be confident that the problem is in coneprog.
I have also noticed that the solver behaves differently depending on the optimalityTolerance.
This was later confirmed when I found out that the problem has already been reported on this forum here.
An other bug I noticed in some solutions is that both Primal and Dual Feasibility report a value, but if I check manually the constraint satisfaction, the feasibility is off by several order of magnitudes.
I am 100% confident that the check I performed is correct because it was performed with a breakpoint placed right after the call to coneprog as shown below.
I have also stored the inputs of coneprog right before the function was called.
In my opinion, if the problem is coneprog as I think it is, the bug is related to the update step of the current guess.
Have you experienced similar problem with coneprog, or are you aware of some limitations it may have?
Did you already encountered such problem and understood where it is coming from?
The main motivations why I think coneprog is the problem are the different outputs produced from a deterministic code, and the fact that, when the problem converges, the solution is correct.
As a final comment, I think it would be really useful to have the freedom of specifying an initial guess.
If I know already a solution that is both an interior point and very close to the optimal one, this would cut down considerably the computational time.
—————————————————————————————————————————-
Below you can find an example of the solver converging to an unfeasible point after some iterations.
The target value of poc is 1e-10.
The formulation of the optimsiation problem is based on a direct transcription to discretise a continuous trajectory into discrete nodes.
The solution vector x is built as:
x = [ux1 uy1 uz1 u1 … uxN uyN uzN uN b1 b2]
where:
[uxi uyi uzi] is the control vector at the i-th node.
ui is the magnitude of the control vector at the i-th node.
[b1 b2] are some end conditions that must satisfy a linear constraint
The only cone constraints present are the one that impose:
sqrt(uxi^2 + uyi^2 + uzi^2) <= 1
sqrt(uxi^2 + uyi^2 + uzi^2) <= ui
The linear objective function minimises the control effort defined as:
In the example below, the trajectory is discretised into 852 nodes.
This is clear from the initial Fval of every iteration that corresponds to the number of nodes, as the initial guess is probably all ones.
The last call of coneprog declares the problem unfeasible and it is the only iteration where Fval increases after the initial guess.
The problem with the constraint satisfication can be understood from the values of the Infeasibilities.
To help the problem converges I defined a lower bound to uxi, uyi, and uzi of -1, and a lower bound to ui of 0.
Similarly, I defined an upper bound to uxi, uyi, uzi, and ui of 1.
An Fval of 1.118894e+03 in the last line of the example below, clearly goes against the upper bound constraint, as the maximum value of Fval allowed by the upper bound is 852.
Instead the sovler is analysing a solution with Fval of approximately 1119, but it thinks that the constraints are satisfied, which is impossible.
Maybe my interpretation of Primal and Dual Feasibility is wrong, but my intuition is suggesting me that coneprog may have some problems.
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.351509e-01 2.500000e-01 8.338790e-02 0.43
1 2.903535e+02 5.653968e-02 4.217479e-02 1.406747e-02 0.46
2 5.760140e+01 1.155766e-02 8.621236e-03 2.875627e-03 0.50
3 1.826360e+01 3.567321e-03 2.660981e-03 8.875744e-04 0.54
4 1.587390e+01 2.115580e-03 1.578080e-03 5.263711e-04 0.58
5 1.496351e+01 1.979895e-03 1.476868e-03 4.926117e-04 0.61
6 1.477297e+01 1.930240e-03 1.439829e-03 4.802573e-04 0.65
7 1.407791e+01 1.740965e-03 1.298643e-03 4.331644e-04 0.69
8 1.195150e+01 1.139652e-03 8.501032e-04 2.835533e-04 0.73
9 1.118074e+01 9.249616e-04 6.899590e-04 2.301369e-04 0.76
10 9.263514e+00 3.932808e-04 2.933610e-04 9.785102e-05 0.80
11 8.435984e+00 1.662211e-04 1.239898e-04 4.135699e-05 0.84
12 8.137082e+00 8.259246e-05 6.160841e-05 2.054958e-05 0.89
13 7.834045e+00 4.811473e-06 3.589036e-06 1.197128e-06 0.93
14 7.817072e+00 4.211285e-07 3.141435e-07 1.047797e-07 0.97
15 7.815469e+00 1.297491e-08 9.741467e-09 3.228250e-09 1.02
16 7.815429e+00 2.773558e-09 3.724366e-09 6.900807e-10 1.05
Optimal solution found.
poc =
4.7669e-05
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 4.148309e-01 2.500000e-01 8.339003e-02 0.24
1 2.936365e+02 7.220152e-02 4.351262e-02 1.451408e-02 0.28
2 3.227398e+01 9.133979e-03 5.504640e-03 1.836128e-03 0.32
3 2.999204e+01 5.626122e-03 3.390612e-03 1.130973e-03 0.36
4 2.891739e+01 5.422358e-03 3.267812e-03 1.090012e-03 0.40
5 2.734221e+01 4.962369e-03 2.990597e-03 9.975440e-04 0.44
6 2.355320e+01 3.776002e-03 2.275627e-03 7.590585e-04 0.48
7 1.765904e+01 1.858229e-03 1.119871e-03 3.735444e-04 0.53
8 1.493406e+01 9.914144e-04 5.974810e-04 1.992958e-04 0.57
9 1.321215e+01 4.284890e-04 2.582311e-04 8.613560e-05 0.61
10 1.247209e+01 1.862607e-04 1.122510e-04 3.744245e-05 0.65
11 1.203916e+01 4.726695e-05 2.848568e-05 9.501685e-06 0.68
12 1.190390e+01 4.898257e-06 2.951962e-06 9.846561e-07 0.73
13 1.188906e+01 1.900382e-07 1.145391e-07 3.820181e-08 0.77
14 1.188847e+01 9.042867e-09 5.942560e-09 1.817813e-09 0.81
Optimal solution found.
poc =
1.7472e-08
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.740554e-01 2.500000e-01 8.338857e-02 0.23
1 2.549188e+02 4.172979e-02 2.789011e-02 9.302867e-03 0.26
2 9.392526e+01 1.561744e-02 1.043792e-02 3.481612e-03 0.30
3 2.667086e+01 4.410425e-03 2.947708e-03 9.832206e-04 0.34
4 2.407913e+01 2.549053e-03 1.703660e-03 5.682632e-04 0.39
5 2.355160e+01 2.499060e-03 1.670247e-03 5.571180e-04 0.43
6 2.324912e+01 2.449195e-03 1.636919e-03 5.460015e-04 0.47
7 2.249923e+01 2.308274e-03 1.542735e-03 5.145858e-04 0.50
8 2.040632e+01 1.851989e-03 1.237777e-03 4.128657e-04 0.54
9 1.970151e+01 1.692941e-03 1.131477e-03 3.774090e-04 0.59
10 1.744126e+01 1.126199e-03 7.526951e-04 2.510647e-04 0.62
11 1.620420e+01 8.023922e-04 5.362790e-04 1.788781e-04 0.66
12 1.474391e+01 3.945190e-04 2.636768e-04 8.795053e-05 0.70
13 1.427557e+01 2.644519e-04 1.767465e-04 5.895455e-05 0.73
14 1.370019e+01 1.011430e-04 6.759892e-05 2.254791e-05 0.77
15 1.348178e+01 3.984925e-05 2.663325e-05 8.883635e-06 0.81
16 1.336507e+01 7.537767e-06 5.037870e-06 1.680402e-06 0.85
17 1.334002e+01 6.477134e-07 4.329037e-07 1.443954e-07 0.88
18 1.333772e+01 1.179424e-08 7.999240e-09 2.629302e-09 0.93
19 1.333768e+01 1.381986e-10 8.290199e-09 3.080877e-11 0.99
Optimal solution found.
poc =
5.3035e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.472650e-01 2.500000e-01 8.338749e-02 0.23
1 2.309201e+02 2.520373e-02 1.814445e-02 6.052081e-03 0.27
2 9.405942e+01 1.047608e-02 7.541850e-03 2.515584e-03 0.31
3 2.721726e+01 3.116075e-03 2.243298e-03 7.482520e-04 0.35
4 2.416710e+01 1.805118e-03 1.299525e-03 4.334564e-04 0.40
5 2.375956e+01 1.781739e-03 1.282694e-03 4.278426e-04 0.43
6 2.358202e+01 1.764206e-03 1.270072e-03 4.236324e-04 0.47
7 2.304355e+01 1.703461e-03 1.226341e-03 4.090461e-04 0.52
8 2.181656e+01 1.527846e-03 1.099914e-03 3.668761e-04 0.56
9 2.124914e+01 1.448597e-03 1.042861e-03 3.478463e-04 0.60
10 1.948615e+01 1.170737e-03 8.428266e-04 2.811248e-04 0.64
11 1.783054e+01 8.717316e-04 6.275695e-04 2.093258e-04 0.68
12 1.708765e+01 7.336925e-04 5.281936e-04 1.761789e-04 0.72
13 1.550449e+01 3.894897e-04 2.803981e-04 9.352676e-05 0.76
14 1.514484e+01 3.155406e-04 2.271613e-04 7.576962e-05 0.80
15 1.441642e+01 1.496860e-04 1.077607e-04 3.594357e-05 0.85
16 1.411738e+01 7.908921e-05 5.693722e-05 1.899141e-05 0.90
17 1.383348e+01 1.063875e-05 7.658959e-06 2.554645e-06 0.95
18 1.380209e+01 2.769706e-06 1.993947e-06 6.650794e-07 0.99
19 1.379178e+01 1.701668e-07 1.225354e-07 4.086155e-08 1.03
20 1.379114e+01 8.779631e-09 6.671732e-09 2.108221e-09 1.07
Optimal solution found.
poc =
1.8216e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.384156e-01 2.500000e-01 8.338731e-02 0.24
1 2.283493e+02 2.314639e-02 1.709909e-02 5.703387e-03 0.29
2 9.475565e+01 9.793019e-03 7.234463e-03 2.413050e-03 0.33
3 2.755188e+01 2.925713e-03 2.161331e-03 7.209104e-04 0.37
4 2.438422e+01 1.697792e-03 1.254221e-03 4.183445e-04 0.41
5 2.398865e+01 1.677057e-03 1.238903e-03 4.132353e-04 0.45
6 2.383017e+01 1.662889e-03 1.228437e-03 4.097444e-04 0.49
7 2.333142e+01 1.612151e-03 1.190955e-03 3.972422e-04 0.53
8 2.217540e+01 1.460099e-03 1.078629e-03 3.597758e-04 0.56
9 2.173362e+01 1.404707e-03 1.037709e-03 3.461270e-04 0.61
10 2.035602e+01 1.210646e-03 8.943487e-04 2.983093e-04 0.65
11 1.865148e+01 9.312689e-04 6.879625e-04 2.294694e-04 0.68
12 1.727485e+01 7.016610e-04 5.183427e-04 1.728928e-04 0.72
13 1.622825e+01 5.067634e-04 3.743647e-04 1.248691e-04 0.76
14 1.539423e+01 3.289696e-04 2.430219e-04 8.105977e-05 0.80
15 1.498430e+01 2.416941e-04 1.785483e-04 5.955466e-05 0.83
16 1.446995e+01 1.222391e-04 9.030248e-05 3.012032e-05 0.87
17 1.418069e+01 5.599477e-05 4.136539e-05 1.379739e-05 0.91
18 1.397083e+01 5.693174e-06 4.205758e-06 1.402827e-06 0.95
19 1.394958e+01 5.174181e-07 3.822538e-07 1.274944e-07 0.99
20 1.394766e+01 4.663196e-08 3.460641e-08 1.149035e-08 1.03
21 1.394748e+01 2.032849e-09 2.212183e-09 5.009042e-10 1.07
Optimal solution found.
poc =
1.0958e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.341137e-01 2.500000e-01 8.338698e-02 0.24
1 9.059917e+02 1.639868e-01 1.227028e-01 4.092728e-02 0.28
2 1.017406e+03 7.906474e-02 5.916006e-02 1.973271e-02 0.31
3 1.124331e+03 4.121461e-03 3.083876e-03 1.028620e-03 0.35
4 1.118894e+03 6.591392e-06 4.931998e-06 1.645058e-06 0.39
5 1.118894e+03 9.882157e-09 7.394312e-09 2.466356e-09 0.43
6 1.118894e+03 1.481584e-11 1.109217e-11 3.698267e-12 0.46
Problem is infeasible.
This was tested on R2025a and R2023a. I am running a trajectory optimisation problem.
The formulation is convexified via slack variables and linearisation and I was testing coneprog as solver.
I noticed some issues with the function that I would like to report and verify if it is my mistake or a bug.
My code is completely deterministic. There is no randomisation and the execution should be 100% reproducible.
Nevertheless, running the same code multiple times with the same input and options leads to different results.
Unlinke fmincon, with coneprog it is impossible to access internal calculation and to understand what is going on, therefore I do not have many insights.
My guess is that a random noise is applied to the initial guess.
In theory this should not be a problem since a convex problem has only one minimum.
In practice, the solver sometimes finds an optimal solution and other times declares the problem unfeasible.
I can solve the same exact problem with an NLP formulation using fmincon, so I know for sure the proble is solvable.
I tried to change the initial conditions and the problem persists.
Sometimes, different minima are found in different calls of the solver.
This is not due to the presence of a flat in the solution space because the fval differ by 1 to 2 orders of magnitude.
Another issue I am having is connected to the iterative procedure I have implemented.
At first I obtain an anlytical initial guess that is numerically propagated.
The constraints are linearised around this reference trajectory and the coneprog is called to solve the problem.
Once the optimal control is obtained, the solution is again propagated and if the error is not below the specified tolerance the process is repeated iteratively.
For some initial conditions the solver works smoothly, but for other it stops at the 5-th or 6-th iteration (declaring the problem unfeasible) when it is really close to the finalise the solution.
Again, it is important to highlight that I am 100% confident that the problem is feasible.
It is important to highlight that some degree of reproducibility is still present.
Even if the solver behaves differently, the number of possible behaviours is limited to just a few outcomes, depending on the initial conditions.
In general, for every problem there are 2 or 3 possible outcomes.
Moreover, some outcomes may occur more frequently than others.
I have spent days trying to find the issue in my code, but now, after testing with fmincon, I am starting to be confident that the problem is in coneprog.
I have also noticed that the solver behaves differently depending on the optimalityTolerance.
This was later confirmed when I found out that the problem has already been reported on this forum here.
An other bug I noticed in some solutions is that both Primal and Dual Feasibility report a value, but if I check manually the constraint satisfaction, the feasibility is off by several order of magnitudes.
I am 100% confident that the check I performed is correct because it was performed with a breakpoint placed right after the call to coneprog as shown below.
I have also stored the inputs of coneprog right before the function was called.
In my opinion, if the problem is coneprog as I think it is, the bug is related to the update step of the current guess.
Have you experienced similar problem with coneprog, or are you aware of some limitations it may have?
Did you already encountered such problem and understood where it is coming from?
The main motivations why I think coneprog is the problem are the different outputs produced from a deterministic code, and the fact that, when the problem converges, the solution is correct.
As a final comment, I think it would be really useful to have the freedom of specifying an initial guess.
If I know already a solution that is both an interior point and very close to the optimal one, this would cut down considerably the computational time.
—————————————————————————————————————————-
Below you can find an example of the solver converging to an unfeasible point after some iterations.
The target value of poc is 1e-10.
The formulation of the optimsiation problem is based on a direct transcription to discretise a continuous trajectory into discrete nodes.
The solution vector x is built as:
x = [ux1 uy1 uz1 u1 … uxN uyN uzN uN b1 b2]
where:
[uxi uyi uzi] is the control vector at the i-th node.
ui is the magnitude of the control vector at the i-th node.
[b1 b2] are some end conditions that must satisfy a linear constraint
The only cone constraints present are the one that impose:
sqrt(uxi^2 + uyi^2 + uzi^2) <= 1
sqrt(uxi^2 + uyi^2 + uzi^2) <= ui
The linear objective function minimises the control effort defined as:
In the example below, the trajectory is discretised into 852 nodes.
This is clear from the initial Fval of every iteration that corresponds to the number of nodes, as the initial guess is probably all ones.
The last call of coneprog declares the problem unfeasible and it is the only iteration where Fval increases after the initial guess.
The problem with the constraint satisfication can be understood from the values of the Infeasibilities.
To help the problem converges I defined a lower bound to uxi, uyi, and uzi of -1, and a lower bound to ui of 0.
Similarly, I defined an upper bound to uxi, uyi, uzi, and ui of 1.
An Fval of 1.118894e+03 in the last line of the example below, clearly goes against the upper bound constraint, as the maximum value of Fval allowed by the upper bound is 852.
Instead the sovler is analysing a solution with Fval of approximately 1119, but it thinks that the constraints are satisfied, which is impossible.
Maybe my interpretation of Primal and Dual Feasibility is wrong, but my intuition is suggesting me that coneprog may have some problems.
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.351509e-01 2.500000e-01 8.338790e-02 0.43
1 2.903535e+02 5.653968e-02 4.217479e-02 1.406747e-02 0.46
2 5.760140e+01 1.155766e-02 8.621236e-03 2.875627e-03 0.50
3 1.826360e+01 3.567321e-03 2.660981e-03 8.875744e-04 0.54
4 1.587390e+01 2.115580e-03 1.578080e-03 5.263711e-04 0.58
5 1.496351e+01 1.979895e-03 1.476868e-03 4.926117e-04 0.61
6 1.477297e+01 1.930240e-03 1.439829e-03 4.802573e-04 0.65
7 1.407791e+01 1.740965e-03 1.298643e-03 4.331644e-04 0.69
8 1.195150e+01 1.139652e-03 8.501032e-04 2.835533e-04 0.73
9 1.118074e+01 9.249616e-04 6.899590e-04 2.301369e-04 0.76
10 9.263514e+00 3.932808e-04 2.933610e-04 9.785102e-05 0.80
11 8.435984e+00 1.662211e-04 1.239898e-04 4.135699e-05 0.84
12 8.137082e+00 8.259246e-05 6.160841e-05 2.054958e-05 0.89
13 7.834045e+00 4.811473e-06 3.589036e-06 1.197128e-06 0.93
14 7.817072e+00 4.211285e-07 3.141435e-07 1.047797e-07 0.97
15 7.815469e+00 1.297491e-08 9.741467e-09 3.228250e-09 1.02
16 7.815429e+00 2.773558e-09 3.724366e-09 6.900807e-10 1.05
Optimal solution found.
poc =
4.7669e-05
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 4.148309e-01 2.500000e-01 8.339003e-02 0.24
1 2.936365e+02 7.220152e-02 4.351262e-02 1.451408e-02 0.28
2 3.227398e+01 9.133979e-03 5.504640e-03 1.836128e-03 0.32
3 2.999204e+01 5.626122e-03 3.390612e-03 1.130973e-03 0.36
4 2.891739e+01 5.422358e-03 3.267812e-03 1.090012e-03 0.40
5 2.734221e+01 4.962369e-03 2.990597e-03 9.975440e-04 0.44
6 2.355320e+01 3.776002e-03 2.275627e-03 7.590585e-04 0.48
7 1.765904e+01 1.858229e-03 1.119871e-03 3.735444e-04 0.53
8 1.493406e+01 9.914144e-04 5.974810e-04 1.992958e-04 0.57
9 1.321215e+01 4.284890e-04 2.582311e-04 8.613560e-05 0.61
10 1.247209e+01 1.862607e-04 1.122510e-04 3.744245e-05 0.65
11 1.203916e+01 4.726695e-05 2.848568e-05 9.501685e-06 0.68
12 1.190390e+01 4.898257e-06 2.951962e-06 9.846561e-07 0.73
13 1.188906e+01 1.900382e-07 1.145391e-07 3.820181e-08 0.77
14 1.188847e+01 9.042867e-09 5.942560e-09 1.817813e-09 0.81
Optimal solution found.
poc =
1.7472e-08
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.740554e-01 2.500000e-01 8.338857e-02 0.23
1 2.549188e+02 4.172979e-02 2.789011e-02 9.302867e-03 0.26
2 9.392526e+01 1.561744e-02 1.043792e-02 3.481612e-03 0.30
3 2.667086e+01 4.410425e-03 2.947708e-03 9.832206e-04 0.34
4 2.407913e+01 2.549053e-03 1.703660e-03 5.682632e-04 0.39
5 2.355160e+01 2.499060e-03 1.670247e-03 5.571180e-04 0.43
6 2.324912e+01 2.449195e-03 1.636919e-03 5.460015e-04 0.47
7 2.249923e+01 2.308274e-03 1.542735e-03 5.145858e-04 0.50
8 2.040632e+01 1.851989e-03 1.237777e-03 4.128657e-04 0.54
9 1.970151e+01 1.692941e-03 1.131477e-03 3.774090e-04 0.59
10 1.744126e+01 1.126199e-03 7.526951e-04 2.510647e-04 0.62
11 1.620420e+01 8.023922e-04 5.362790e-04 1.788781e-04 0.66
12 1.474391e+01 3.945190e-04 2.636768e-04 8.795053e-05 0.70
13 1.427557e+01 2.644519e-04 1.767465e-04 5.895455e-05 0.73
14 1.370019e+01 1.011430e-04 6.759892e-05 2.254791e-05 0.77
15 1.348178e+01 3.984925e-05 2.663325e-05 8.883635e-06 0.81
16 1.336507e+01 7.537767e-06 5.037870e-06 1.680402e-06 0.85
17 1.334002e+01 6.477134e-07 4.329037e-07 1.443954e-07 0.88
18 1.333772e+01 1.179424e-08 7.999240e-09 2.629302e-09 0.93
19 1.333768e+01 1.381986e-10 8.290199e-09 3.080877e-11 0.99
Optimal solution found.
poc =
5.3035e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.472650e-01 2.500000e-01 8.338749e-02 0.23
1 2.309201e+02 2.520373e-02 1.814445e-02 6.052081e-03 0.27
2 9.405942e+01 1.047608e-02 7.541850e-03 2.515584e-03 0.31
3 2.721726e+01 3.116075e-03 2.243298e-03 7.482520e-04 0.35
4 2.416710e+01 1.805118e-03 1.299525e-03 4.334564e-04 0.40
5 2.375956e+01 1.781739e-03 1.282694e-03 4.278426e-04 0.43
6 2.358202e+01 1.764206e-03 1.270072e-03 4.236324e-04 0.47
7 2.304355e+01 1.703461e-03 1.226341e-03 4.090461e-04 0.52
8 2.181656e+01 1.527846e-03 1.099914e-03 3.668761e-04 0.56
9 2.124914e+01 1.448597e-03 1.042861e-03 3.478463e-04 0.60
10 1.948615e+01 1.170737e-03 8.428266e-04 2.811248e-04 0.64
11 1.783054e+01 8.717316e-04 6.275695e-04 2.093258e-04 0.68
12 1.708765e+01 7.336925e-04 5.281936e-04 1.761789e-04 0.72
13 1.550449e+01 3.894897e-04 2.803981e-04 9.352676e-05 0.76
14 1.514484e+01 3.155406e-04 2.271613e-04 7.576962e-05 0.80
15 1.441642e+01 1.496860e-04 1.077607e-04 3.594357e-05 0.85
16 1.411738e+01 7.908921e-05 5.693722e-05 1.899141e-05 0.90
17 1.383348e+01 1.063875e-05 7.658959e-06 2.554645e-06 0.95
18 1.380209e+01 2.769706e-06 1.993947e-06 6.650794e-07 0.99
19 1.379178e+01 1.701668e-07 1.225354e-07 4.086155e-08 1.03
20 1.379114e+01 8.779631e-09 6.671732e-09 2.108221e-09 1.07
Optimal solution found.
poc =
1.8216e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.384156e-01 2.500000e-01 8.338731e-02 0.24
1 2.283493e+02 2.314639e-02 1.709909e-02 5.703387e-03 0.29
2 9.475565e+01 9.793019e-03 7.234463e-03 2.413050e-03 0.33
3 2.755188e+01 2.925713e-03 2.161331e-03 7.209104e-04 0.37
4 2.438422e+01 1.697792e-03 1.254221e-03 4.183445e-04 0.41
5 2.398865e+01 1.677057e-03 1.238903e-03 4.132353e-04 0.45
6 2.383017e+01 1.662889e-03 1.228437e-03 4.097444e-04 0.49
7 2.333142e+01 1.612151e-03 1.190955e-03 3.972422e-04 0.53
8 2.217540e+01 1.460099e-03 1.078629e-03 3.597758e-04 0.56
9 2.173362e+01 1.404707e-03 1.037709e-03 3.461270e-04 0.61
10 2.035602e+01 1.210646e-03 8.943487e-04 2.983093e-04 0.65
11 1.865148e+01 9.312689e-04 6.879625e-04 2.294694e-04 0.68
12 1.727485e+01 7.016610e-04 5.183427e-04 1.728928e-04 0.72
13 1.622825e+01 5.067634e-04 3.743647e-04 1.248691e-04 0.76
14 1.539423e+01 3.289696e-04 2.430219e-04 8.105977e-05 0.80
15 1.498430e+01 2.416941e-04 1.785483e-04 5.955466e-05 0.83
16 1.446995e+01 1.222391e-04 9.030248e-05 3.012032e-05 0.87
17 1.418069e+01 5.599477e-05 4.136539e-05 1.379739e-05 0.91
18 1.397083e+01 5.693174e-06 4.205758e-06 1.402827e-06 0.95
19 1.394958e+01 5.174181e-07 3.822538e-07 1.274944e-07 0.99
20 1.394766e+01 4.663196e-08 3.460641e-08 1.149035e-08 1.03
21 1.394748e+01 2.032849e-09 2.212183e-09 5.009042e-10 1.07
Optimal solution found.
poc =
1.0958e-10
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
0 8.520000e+02 3.341137e-01 2.500000e-01 8.338698e-02 0.24
1 9.059917e+02 1.639868e-01 1.227028e-01 4.092728e-02 0.28
2 1.017406e+03 7.906474e-02 5.916006e-02 1.973271e-02 0.31
3 1.124331e+03 4.121461e-03 3.083876e-03 1.028620e-03 0.35
4 1.118894e+03 6.591392e-06 4.931998e-06 1.645058e-06 0.39
5 1.118894e+03 9.882157e-09 7.394312e-09 2.466356e-09 0.43
6 1.118894e+03 1.481584e-11 1.109217e-11 3.698267e-12 0.46
Problem is infeasible.
This was tested on R2025a and R2023a. coneprog, bug MATLAB Answers — New Questions
Using the SharePoint Site Attestation Policy
Forcing Owners to Confirm Details of Their Sites
The site attestation policy is part of the site lifecycle management component of SharePoint advanced management (SAM). It’s also one of the SAM features available to tenants with Microsoft 365 Copilot licenses. The basic idea is to force site owners to periodically attest that the settings of their site, including its membership, remain valid. If the site owners can’t or don’t confirm the site details, SharePoint Online can enforce an action such as archiving the site.
Microsoft 365 roadmap item 494159 lists the site attestation policy as generally available from August 2025. However, that’s not quite the case as the policy is still listed in the SharePoint admin center as a preview feature (Figure 1).

Imposing site attestation can clear out many sites that form the digital debris that clogs up Microsoft 365 tenants. Apart from releasing expensive SharePoint “hot” storage by moving the content of non-attested sites into “cold” archive storage, the biggest benefit is to remove the files held in these sites from Copilot processing. This reduces the risk that obsolete and incorrect information will find its way into Copilot responses and improves the overall quality of Copilot processing.
Configuring a Site Attestation Policy
Like the other site lifecycle policies, configuring a site attestation policy is pretty straightforward. The usual process is to configure a policy in simulation mode so that the policy runs to generate a report about the sites within the policy scope for administrators to review.
Scoping means defining what sites the policy should process, like all team-connected sites. In Figure 2 I’ve selected to combine several criteria to form a precise scope. You can select one or more container management sensitivity labels to use. Filtering by site creation source is interesting because it allows you to select sites created using methods like PnP, PowerShell, or the SharePoint admin center. Running the policy in simulation mode will create a report to tell you exactly what sites match the scope.

The policy configuration specifies how often the policy runs, who must attest sites, and what SharePoint Online should do if attestation doesn’t happen. In Figure 3, we see the configuration for an annual review where lack of attestation by site owners leads to sites being moved to Microsoft 365 Archive.

Given that most SharePoint Online sites are used with Teams and that many Microsoft 365 tenant administrators probably couldn’t differentiate between site owners and site administrators, I wonder if the configuration could be simplified to a single option that combines the two. Just a thought.
After running in simulation to identify any issues and making necessary tweaks, such as including or excluding certain sites, the attestation policy can be launched to do its business.
Site Owner Actions
Turning on the site attestation policy causes SharePoint Online to send Outlook actionable messages to site owners to ask them to confirm site details. I received 63 messages within ten minutes, including duplicate messages for a couple of sites.
The initial message (Figure 4 left) informs the site owners about their responsibilities and sets a attestation deadline. Pressing the “Yes, settings are accurate” button allows the owner to attest that everything is OK without leaving the message. Acknowledgement is automatic by updating the same message (Figure 4 – right).

You’ll notice that no button exists for a site owner to declare that the site settings are inaccurate. The assumption is that the site owner will simply ignore the messages sent by SharePoint Online. After three monthly warnings, SharePoint will enforce the action set in the policy. It would be nice to give site owners the ability to accelerate the process with an option to take the policy action immediately. Maybe that will come in a future release.
Removing Digital Debris is Goodness
Regular site attestation seems like a solid idea. Anything to remove debris from a tenant is goodness. One concern that I have is that moving a team-connected site to Microsoft 365 Archive does nothing to affect the team. Users won’t be able to access files in the SharePoint site, but shouldn’t an archive action process everything? After all, Teams supports team archiving.
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
SIMULINK launching Logic Analyzer causes memory leak
Hi all,
I have built a testbench in SIMULINK 2024b usaing the vision HDL toolbox for streaming in video from a test file (.avi) passing through a DUT and then displaying video using the video viewer.
When I try to run a simulation where I stream out 3 of my 1280×1024 8bit pixles from the file (by setting stop time to 36ms), convert to a pixel stream, convert back to a frame and view the video, it works! However, when I try to open the logic analyser to view my 6 logged signals after (or have it open before and run the simulation) MATLAB completely halts, and i have to force quit from the task manager.
From the task manager I can see the Memory consumed by MATLAB rise continually as if there is a memory leak. What is going on here?
Update:
I have removed more and more blocks in my design and have tracked the problem down i believe to the pixels to frame block
Above is a heavily simplified version of my design I/O. Video loaded in from file, converted to pixel stream, then back to a frame and into a display. However Running simulation crashes my matlab – but not immediately:
I open the design and configure my stop time to be equivalent to three frames worth, then I open the logic analyzer to view my logged signals. Then I commence the simulation. The 3 frames appear correctly in the video viewer, but my logged signals do not appear. Then a swirly Icon appears on my logic analyzer and there is a massive surge in memory usage from MATLAB (~20GB). I have to force quit the application.
Note: when I comment out the pixels to frame and video viewer, the logic analyser works completely fine for reading data out of the frame to pixels block
What is going on?Hi all,
I have built a testbench in SIMULINK 2024b usaing the vision HDL toolbox for streaming in video from a test file (.avi) passing through a DUT and then displaying video using the video viewer.
When I try to run a simulation where I stream out 3 of my 1280×1024 8bit pixles from the file (by setting stop time to 36ms), convert to a pixel stream, convert back to a frame and view the video, it works! However, when I try to open the logic analyser to view my 6 logged signals after (or have it open before and run the simulation) MATLAB completely halts, and i have to force quit from the task manager.
From the task manager I can see the Memory consumed by MATLAB rise continually as if there is a memory leak. What is going on here?
Update:
I have removed more and more blocks in my design and have tracked the problem down i believe to the pixels to frame block
Above is a heavily simplified version of my design I/O. Video loaded in from file, converted to pixel stream, then back to a frame and into a display. However Running simulation crashes my matlab – but not immediately:
I open the design and configure my stop time to be equivalent to three frames worth, then I open the logic analyzer to view my logged signals. Then I commence the simulation. The 3 frames appear correctly in the video viewer, but my logged signals do not appear. Then a swirly Icon appears on my logic analyzer and there is a massive surge in memory usage from MATLAB (~20GB). I have to force quit the application.
Note: when I comment out the pixels to frame and video viewer, the logic analyser works completely fine for reading data out of the frame to pixels block
What is going on? Hi all,
I have built a testbench in SIMULINK 2024b usaing the vision HDL toolbox for streaming in video from a test file (.avi) passing through a DUT and then displaying video using the video viewer.
When I try to run a simulation where I stream out 3 of my 1280×1024 8bit pixles from the file (by setting stop time to 36ms), convert to a pixel stream, convert back to a frame and view the video, it works! However, when I try to open the logic analyser to view my 6 logged signals after (or have it open before and run the simulation) MATLAB completely halts, and i have to force quit from the task manager.
From the task manager I can see the Memory consumed by MATLAB rise continually as if there is a memory leak. What is going on here?
Update:
I have removed more and more blocks in my design and have tracked the problem down i believe to the pixels to frame block
Above is a heavily simplified version of my design I/O. Video loaded in from file, converted to pixel stream, then back to a frame and into a display. However Running simulation crashes my matlab – but not immediately:
I open the design and configure my stop time to be equivalent to three frames worth, then I open the logic analyzer to view my logged signals. Then I commence the simulation. The 3 frames appear correctly in the video viewer, but my logged signals do not appear. Then a swirly Icon appears on my logic analyzer and there is a massive surge in memory usage from MATLAB (~20GB). I have to force quit the application.
Note: when I comment out the pixels to frame and video viewer, the logic analyser works completely fine for reading data out of the frame to pixels block
What is going on? computer vision, image processing, simulink, video MATLAB Answers — New Questions
polar/plot incompatibility
Can any one explain the design choise that causes this:
polarscatter(linspace(0,pi*2/3,100).^2,…
linspace(0,pi*2/3,100),…
32,…
linspace(0,pi*2/3,100),’filled’)
hold on
plot([-1 1],[1 -1],’m’)
Error using newplot
Adding Cartesian plot to polaraxes is not supported.
Error in matlab.graphics.internal.newplotwrapper (line 11)
axReturn = newplot(varargin{:});
From my perspective picking polar/cartesian representation of my grid is just that – a choise of either cartesian grid-lines of polar grid-lines. Why should it not be possible to add objects with cartesian coordinates to a region with polar grid-lines or the other way around?Can any one explain the design choise that causes this:
polarscatter(linspace(0,pi*2/3,100).^2,…
linspace(0,pi*2/3,100),…
32,…
linspace(0,pi*2/3,100),’filled’)
hold on
plot([-1 1],[1 -1],’m’)
Error using newplot
Adding Cartesian plot to polaraxes is not supported.
Error in matlab.graphics.internal.newplotwrapper (line 11)
axReturn = newplot(varargin{:});
From my perspective picking polar/cartesian representation of my grid is just that – a choise of either cartesian grid-lines of polar grid-lines. Why should it not be possible to add objects with cartesian coordinates to a region with polar grid-lines or the other way around? Can any one explain the design choise that causes this:
polarscatter(linspace(0,pi*2/3,100).^2,…
linspace(0,pi*2/3,100),…
32,…
linspace(0,pi*2/3,100),’filled’)
hold on
plot([-1 1],[1 -1],’m’)
Error using newplot
Adding Cartesian plot to polaraxes is not supported.
Error in matlab.graphics.internal.newplotwrapper (line 11)
axReturn = newplot(varargin{:});
From my perspective picking polar/cartesian representation of my grid is just that – a choise of either cartesian grid-lines of polar grid-lines. Why should it not be possible to add objects with cartesian coordinates to a region with polar grid-lines or the other way around? polar plot MATLAB Answers — New Questions
Issue Saving image with text overlay to png
I am having issues saving an image that has been displayed in a figure, with a couple markers plotted at specific coordinates and then text overlaid using the text function. I am trying to safe this off as a png via saveas(gcf,’filename.png’); and the figure exports but the overlaid text is missing. The title and the marker points I plotted show up but no text. Below is the figure.
Attached is the exported png using saveas
My code looks as follows:
figure; imshow(img,[]);
hold on;
plot(Stats(TestNum).Centroid(1),Stats(TestNum).Centroid(2),’b*’);
set(gca, ‘ActivePositionProperty’, ‘OuterPosition’);
[filepath,name,ext] = fileparts(files(TestNum).name);
title({[];name;[‘Original Image With Centroid Marked’]},’FontSize’,FontSize);
text(20,500,{[‘Area = ‘,num2str(Stats(TestNum).Area.*pixel_scale^2,’%3.2f’),’mm^2′];…
[‘Eccentricity = ‘,num2str(Stats(TestNum).Eccentricity,’%3.2f’)];…
[‘Orientation = ‘,num2str(Stats(TestNum).Orientation,’%3.2f’),char(176)];…
[‘Major Axis Length = ‘,num2str(Stats(TestNum).MajorAxisLength.*pixel_scale,’%3.2f’),’mm’];…
[‘Minor Axis Length = ‘,num2str(Stats(TestNum).MinorAxisLength.*pixel_scale,’%3.2f’),’mm’]},…
‘Color’,’white’,’FontSize’,FontSize);
saveas(gcf,[pwd ‘outputTest ‘,num2str(TestNum),’TubeMidpointCrossSection – Test ‘,num2str(TestNum),’.png’]);I am having issues saving an image that has been displayed in a figure, with a couple markers plotted at specific coordinates and then text overlaid using the text function. I am trying to safe this off as a png via saveas(gcf,’filename.png’); and the figure exports but the overlaid text is missing. The title and the marker points I plotted show up but no text. Below is the figure.
Attached is the exported png using saveas
My code looks as follows:
figure; imshow(img,[]);
hold on;
plot(Stats(TestNum).Centroid(1),Stats(TestNum).Centroid(2),’b*’);
set(gca, ‘ActivePositionProperty’, ‘OuterPosition’);
[filepath,name,ext] = fileparts(files(TestNum).name);
title({[];name;[‘Original Image With Centroid Marked’]},’FontSize’,FontSize);
text(20,500,{[‘Area = ‘,num2str(Stats(TestNum).Area.*pixel_scale^2,’%3.2f’),’mm^2′];…
[‘Eccentricity = ‘,num2str(Stats(TestNum).Eccentricity,’%3.2f’)];…
[‘Orientation = ‘,num2str(Stats(TestNum).Orientation,’%3.2f’),char(176)];…
[‘Major Axis Length = ‘,num2str(Stats(TestNum).MajorAxisLength.*pixel_scale,’%3.2f’),’mm’];…
[‘Minor Axis Length = ‘,num2str(Stats(TestNum).MinorAxisLength.*pixel_scale,’%3.2f’),’mm’]},…
‘Color’,’white’,’FontSize’,FontSize);
saveas(gcf,[pwd ‘outputTest ‘,num2str(TestNum),’TubeMidpointCrossSection – Test ‘,num2str(TestNum),’.png’]); I am having issues saving an image that has been displayed in a figure, with a couple markers plotted at specific coordinates and then text overlaid using the text function. I am trying to safe this off as a png via saveas(gcf,’filename.png’); and the figure exports but the overlaid text is missing. The title and the marker points I plotted show up but no text. Below is the figure.
Attached is the exported png using saveas
My code looks as follows:
figure; imshow(img,[]);
hold on;
plot(Stats(TestNum).Centroid(1),Stats(TestNum).Centroid(2),’b*’);
set(gca, ‘ActivePositionProperty’, ‘OuterPosition’);
[filepath,name,ext] = fileparts(files(TestNum).name);
title({[];name;[‘Original Image With Centroid Marked’]},’FontSize’,FontSize);
text(20,500,{[‘Area = ‘,num2str(Stats(TestNum).Area.*pixel_scale^2,’%3.2f’),’mm^2′];…
[‘Eccentricity = ‘,num2str(Stats(TestNum).Eccentricity,’%3.2f’)];…
[‘Orientation = ‘,num2str(Stats(TestNum).Orientation,’%3.2f’),char(176)];…
[‘Major Axis Length = ‘,num2str(Stats(TestNum).MajorAxisLength.*pixel_scale,’%3.2f’),’mm’];…
[‘Minor Axis Length = ‘,num2str(Stats(TestNum).MinorAxisLength.*pixel_scale,’%3.2f’),’mm’]},…
‘Color’,’white’,’FontSize’,FontSize);
saveas(gcf,[pwd ‘outputTest ‘,num2str(TestNum),’TubeMidpointCrossSection – Test ‘,num2str(TestNum),’.png’]); saveas, text, png file, figure, overlaid text MATLAB Answers — New Questions
Monitor losses in MOSFET in SimScape
Using the Simscape probe, I can observe the latest turn-on and turn-off switching losses during the simulation. Do these values include both MOSFET and body-diode losses, or can body-diode (reverse-recovery) losses be monitored separately so that the probe’s losses correspond exclusively to the MOSFET?Using the Simscape probe, I can observe the latest turn-on and turn-off switching losses during the simulation. Do these values include both MOSFET and body-diode losses, or can body-diode (reverse-recovery) losses be monitored separately so that the probe’s losses correspond exclusively to the MOSFET? Using the Simscape probe, I can observe the latest turn-on and turn-off switching losses during the simulation. Do these values include both MOSFET and body-diode losses, or can body-diode (reverse-recovery) losses be monitored separately so that the probe’s losses correspond exclusively to the MOSFET? power losses in mosfet simscape MATLAB Answers — New Questions
Editing the format of a chart title in excel through actxserver
I have been trying to work out how to underscore a section of a chart title string in an existing chart in excel through actxserver. I would typically use invoke to format strings in excel cells, but I can’t use that approach in chart titles.
In the code below I am replacing a section of the title string, which has a portion already underscored. This automically underscoes the whole title for some reason, which I then remove and try to underscore just the section that was already underscored.
If anyone has a solution it would be much appreciated. I have tried different LLMs, but this is the method they suggest. Which should work based on excel VBA. Possibly this is just not supported in Matlab?
Example of editing characters in a chart title that doesn’t work.
excel = actxserver(‘Excel.Application’);
file = excel.Workbooks.Open("ABC.xlsx");
Sheet = excel.Worksheets.Item(‘ABC’);
ChartObjects = Sheet.ChartObjects;
chart = ChartObjects.Item(1).Chart; % Selecting chart
s = chart.ChartTitle.Text; % find current chart title
chart.ChartTitle.Text = strrep(s, OldWord, NewWord); % Replace key word in chart title
chart.ChartTitle.Characters.Font.Underline = 0; % Removing all underscored characters
pos = strfind(s, ‘-‘); % finding end of region to underline
% Works up to this last line
chart.ChartTitle.Characters(1, pos(1)-2).Font.Underline = 2; % Underscoring desired region
Example for editing a string in a excel cell that works.
Range = get(Sheet,’Range’, ‘A1’);
Range.Value = {‘(Test Area = 21.65 cm2)’};
Chars = invoke(Range,’Characters’,22,1); % Selecting character range within cell starting at character 22 and continuing for 1 length
Chars.Font.Superscript = ‘true’; % Seting selected character to supersciptI have been trying to work out how to underscore a section of a chart title string in an existing chart in excel through actxserver. I would typically use invoke to format strings in excel cells, but I can’t use that approach in chart titles.
In the code below I am replacing a section of the title string, which has a portion already underscored. This automically underscoes the whole title for some reason, which I then remove and try to underscore just the section that was already underscored.
If anyone has a solution it would be much appreciated. I have tried different LLMs, but this is the method they suggest. Which should work based on excel VBA. Possibly this is just not supported in Matlab?
Example of editing characters in a chart title that doesn’t work.
excel = actxserver(‘Excel.Application’);
file = excel.Workbooks.Open("ABC.xlsx");
Sheet = excel.Worksheets.Item(‘ABC’);
ChartObjects = Sheet.ChartObjects;
chart = ChartObjects.Item(1).Chart; % Selecting chart
s = chart.ChartTitle.Text; % find current chart title
chart.ChartTitle.Text = strrep(s, OldWord, NewWord); % Replace key word in chart title
chart.ChartTitle.Characters.Font.Underline = 0; % Removing all underscored characters
pos = strfind(s, ‘-‘); % finding end of region to underline
% Works up to this last line
chart.ChartTitle.Characters(1, pos(1)-2).Font.Underline = 2; % Underscoring desired region
Example for editing a string in a excel cell that works.
Range = get(Sheet,’Range’, ‘A1’);
Range.Value = {‘(Test Area = 21.65 cm2)’};
Chars = invoke(Range,’Characters’,22,1); % Selecting character range within cell starting at character 22 and continuing for 1 length
Chars.Font.Superscript = ‘true’; % Seting selected character to superscipt I have been trying to work out how to underscore a section of a chart title string in an existing chart in excel through actxserver. I would typically use invoke to format strings in excel cells, but I can’t use that approach in chart titles.
In the code below I am replacing a section of the title string, which has a portion already underscored. This automically underscoes the whole title for some reason, which I then remove and try to underscore just the section that was already underscored.
If anyone has a solution it would be much appreciated. I have tried different LLMs, but this is the method they suggest. Which should work based on excel VBA. Possibly this is just not supported in Matlab?
Example of editing characters in a chart title that doesn’t work.
excel = actxserver(‘Excel.Application’);
file = excel.Workbooks.Open("ABC.xlsx");
Sheet = excel.Worksheets.Item(‘ABC’);
ChartObjects = Sheet.ChartObjects;
chart = ChartObjects.Item(1).Chart; % Selecting chart
s = chart.ChartTitle.Text; % find current chart title
chart.ChartTitle.Text = strrep(s, OldWord, NewWord); % Replace key word in chart title
chart.ChartTitle.Characters.Font.Underline = 0; % Removing all underscored characters
pos = strfind(s, ‘-‘); % finding end of region to underline
% Works up to this last line
chart.ChartTitle.Characters(1, pos(1)-2).Font.Underline = 2; % Underscoring desired region
Example for editing a string in a excel cell that works.
Range = get(Sheet,’Range’, ‘A1’);
Range.Value = {‘(Test Area = 21.65 cm2)’};
Chars = invoke(Range,’Characters’,22,1); % Selecting character range within cell starting at character 22 and continuing for 1 length
Chars.Font.Superscript = ‘true’; % Seting selected character to superscipt actxserver, excel, chart title, underscore MATLAB Answers — New Questions
Modernizing Sensitivity Label Grouping for App Display
The End of Parent-Child Label Relationships
Message center notification MC1111778 (last updated 24 September 2025, Microsoft 365 roadmap item 386900) announces the modernization of sensitivity label grouping to a “dynamic architecture” consisting of labels and label grouping rather than parent and child labels. The new architecture supports moving sensitivity labels between groups “without losing referential integrity.” In other words, the settings of sensitivity labels remain intact when they are moved from one label group to another.
Removing the Last Vestiges of AIP
When Microsoft launched Azure Information Protection (AIP) labels in 2016, they adopted a two-tier parent-child model for organizing the display of labels. In this model, the parent label functions as a navigation location for child labels and cannot be applied to files. When sensitivity labels took over from AIP labels, the same arrangement was kept. In Figure 1, the Secret label is the parent and the All Company and My Team are child labels.

When details of an assigned label are viewed in client user interfaces, the structure is displayed as ParentChild (Figure 2).

The problem with the parent-child structure is its strict nature. Once a child label is created and deployed in active use, it becomes very difficult (if not practically impossible) to change the labeling structure to reflect current business requirements. The inflexible nature of the parent-child structure is the main reason why I never recommended its use to customers. It’s difficult enough to construct a workable labeling structure for a tenant without having to deal with inflexible groupings.
Public Preview and Migration
Microsoft is currently deploying the modern label architecture in public preview with the aim of attaining general availability in December 2025. New tenants created after 1 October 2025 must use the new architecture. No administrator action is required before general availability occurs, but it might be a good idea afterwards to review the current label structure to see if sensitivity labels can be presented in more effective manner to end users.
When a tenant is upgraded, any existing parent-child groups are migrated to the new architecture. During the preview, if a tenant has parent-child label groups, they can use the manual migration method invoked from the Information Protection section of the Purview portal (Figure 3). Migration is an irreversible process, so take the time to read up before plunging ahead and migrate a set of sensitivity labels in a test tenant first.

Launching the migration is preceded by notification of what the expected outcome will be (Figure 4). My tenant has used sensitivity labels since their AIP predecessors and has accumulated many different sensitivity labels used for content protection and container management over the years, including two parent-child groups (for testing only).

The migration took just a few seconds and only difference seen afterwards is that the parent labels are now label groups and the child labels are members of those groups. The Secret parent viewed earlier became a label group and also a standalone sensitivity label. The standalone label takes the name, GUID, and settings as the original parent label. Following the migration, I updated the display name of the affected labels and label groups to make their function obvious.
The new architecture exposes options in the Purview portal to move sensitivity labels into and out of groups. This is the big advantage of the change as administrators can now easily construct and change label groups according to business demands. For instance, I created a label group called Email Labels to organize the sensitivity labels most appopriately used for email to give additional guidance to end users. Figure 5 shows how the new label group appears in OWA.

Notice how all the sensitivity labels in the Email Labels group have the same label color. This might affect the carefully-crafted custom colors you might have assigned to sensitivity labels in the past. Another important change is that the standalone labels moved into the label group have priority orders based on the priority assigned to the label group. Label priority is supposed to indicate the degree of confidentiality or sensitivity of files that labels are applied to, so some rearrangement of labels is probably needed here. A change in label priority can lead to an increase in document mismatch notifications, and that’s not a good thing.
Although you can move container management labels into label groups there’s no point in doing so. First, organizations tend to have relatively few container management labels, so there’s no need for grouping. Second, the applications that use container management labels, like Teams and SharePoint Online, display container management labels in a simple list.
PowerShell Changes
A set of cmdlets in the security and compliance module support sensitivity labels. The label settings manipulated by the cmdlets use the same properties to update label group membership as was used to associate a child label with a parent label. For instance, a label group has the isParent and isLabelGroup settings set to true:
$Label = Get-Label -Identity 'Email Labels' $Label.Settings [isparent, True] [islabelgroup, True]
A sensitivity label in a label group has the isParent property set to false and the identifier for the label group in its ParentId property:
$Label = Get-Label -Identity '1b070e6f-4b3c-4534-95c4-08335a5ca610' $Label.Settings [contenttype, File, Email] [isparent, False] [parentid, 62acd157-1757-4361-9a53-71ea316279ca]
To move a label into a label group, run the Set-Label cmdlet and update the ParentId parameter with the identifier for the label group. Here’s an example of moving a label into the Email Labels group:
Set-Label -Identity 'Employee Confidential' -ParentId (Get-Label -Identity 'Email Labels').ImmutableId
To move a sensitivity label out of a label group, pass $null or the identifier for another label group as the parent identifier.
Heading to a New Architecture
Referring to a new way to manage sensitivity labels for display in applications as a new architecture is a stretch. However, it’s still a good change. It will take time for tenants to figure out how to best use label groups, but that will come in time. In the meantime, the task is to migrate to the new architecture, either manually or by waiting just a few more weeks.
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
The next chapter of the Microsoft–OpenAI partnership
Since 2019, Microsoft and OpenAI have shared a vision to advance artificial intelligence responsibly and make its benefits broadly accessible. What began as an investment in a research organization has grown into one of the most successful partnerships in our industry. As we enter the next phase of this partnership, we’ve signed a new definitive agreement that builds on our foundation, strengthens our partnership, and sets the stage for long-term success for both organizations.
First, Microsoft supports the OpenAI board moving forward with formation of a public benefit corporation (PBC) and recapitalization. Following the recapitalization, Microsoft holds an investment in OpenAI Group PBC valued at approximately $135 billion, representing roughly 27 percent on an as-converted diluted basis, inclusive of all owners – employees, investors, and the OpenAI Foundation. Excluding the impact of OpenAI’s recent funding rounds, Microsoft held a 32.5 percent stake on an as-converted basis in the OpenAI for-profit.
The agreement preserves key elements that have fueled this successful partnership – meaning OpenAI remains Microsoft’s frontier model partner and Microsoft continues to have exclusive IP rights and Azure API exclusivity until Artificial General Intelligence (AGI).
It also refines and adds new provisions that enable each company to independently continue advancing innovation and growth.
What has evolved:
- Once AGI is declared by OpenAI, that declaration will now be verified by an independent expert panel.
- Microsoft’s IP rights for both models and products are extended through 2032 and now include models post-AGI, with appropriate safety guardrails.
- Microsoft’s IP rights to research, defined as the confidential methods used in the development of models and systems, will remain until either the expert panel verifies AGI or through 2030, whichever is first. Research IP includes, for example, models intended for internal deployment or research only. Beyond that research IP does not include model architecture, model weights, inference code, finetuning code, and any IP related to data center hardware and software; and Microsoft retains these non-Research IP rights.
- Microsoft’s IP rights now exclude OpenAI’s consumer hardware.
- OpenAI can now jointly develop some products with third parties. API products developed with third parties will be exclusive to Azure. Non-API products may be served on any cloud provider.
- Microsoft can now independently pursue AGI alone or in partnership with third parties.
- If Microsoft uses OpenAI’s IP to develop AGI, prior to AGI being declared, the models will be subject to compute thresholds; those thresholds are significantly larger than the size of systems used to train leading models today.
- The revenue share agreement remains until the expert panel verifies AGI, though payments will be made over a longer period of time.
- OpenAI has contracted to purchase an incremental $250B of Azure services, and Microsoft will no longer have a right of first refusal to be OpenAI’s compute provider.
- OpenAI can now provide API access to US government national security customers, regardless of the cloud provider.
- OpenAI is now able to release open weight models that meet requisite capability criteria.
As we step into this next chapter of our partnership, both companies are better positioned than ever to continue building great products that meet real-world needs, and create new opportunity for everyone and every business.
The post The next chapter of the Microsoft–OpenAI partnership appeared first on The Official Microsoft Blog.
Since 2019, Microsoft and OpenAI have shared a vision to advance artificial intelligence responsibly and make its benefits broadly accessible. What began as an investment in a research organization has grown into one of the most successful partnerships in our industry. As we enter the next phase of this partnership, we’ve signed a new definitive…
The post The next chapter of the Microsoft–OpenAI partnership appeared first on The Official Microsoft Blog.Read More
Becoming Frontier: How human ambition and AI-first differentiation are helping Microsoft customers go further with AI
Over the past few years, we have driven remarkable progress accelerating AI innovation together with our customers and partners. We are achieving efficiency and productivity at scale to shape industries and markets around the world. It is time to demand more of AI to solve humanity’s biggest challenges by democratizing intelligence, obsolescing the mundane and unlocking creativity. This is the notion of becoming Frontier: to empower human ambition and find AI-first differentiation in everything we do to maximize an organization’s potential and our impact on society.
Microsoft’s technology portfolio ensures our customers can go further with AI on their way to becoming Frontier firms, using our AI Transformation success framework as their guide. Our AI business solutions are dramatically changing how people gain actionable insights from data — fusing the capabilities of AI agents and Copilots while keeping humans at the center. We have the largest, most scalable, most capable cloud and AI platform in the industry for our customers to build upon their aspirations. We remain deeply focused on ensuring AI is used responsibly and securely, and embed security into everything we do to help our customers prioritize cybersecurity and guard against threats.
We are fortunate to work with thousands of customers and partners around the world — across every geography and industry. I am pleased to share some of the customer stories being showcased at our recently opened Experience Center One facility — each exemplifying the path to becoming Frontier.
Driven by a commitment to innovation, sustainability and operational excellence, ADNOC is helping meet the world’s growing energy demands safely and reliably, while accelerating decarbonization efforts. To empower its workforce, the company introduced OneTalent — a unified AI-powered platform consolidating over 16 legacy HR processes into a single, intelligent system that furthers its dedication to nurturing talent, aligning people with strategic goals and turning every member of its workforce into an AI collaborator. Partnering with Microsoft and AIQ, ADNOC applied AI across its operations to reimagine everything from seismic analysis to predictive maintenance. ENERGYai and Neuron 5 — AI-powered platforms built natively on Azure OpenAI — turn complexity into actionable insights. The platforms use predictive models to reduce downtime — by as much as 50% at one plant. They are also using autonomous agents to optimize energy use; unlocking data-driven insights that have accelerated energy workflows from months or years to just days or minutes.
Asset manager and technology provider BlackRock has been on a journey to infuse AI to level up how its organization operates across three key pillars: how they invest, how they operate and how they serve clients. To accelerate this mission, they partnered with Microsoft to transform processes across the investment management lifecycle by integrating cloud and AI technologies alongside its Aladdin platform. Embedded across 20 applications and accessed by tens of thousands of users, the Aladdin platform’s AI capabilities deliver functionally relevant tools to help redefine workflows for different types of financial service professionals. Client relationship managers are saving hours per client, reducing duplication and improving accuracy by evaluating CRM and market data to generate personalized client briefs and opportunity analyses using natural language processing — supported by verification and review methods that facilitate accuracy and compliance. Investment compliance officers are streamlining portfolio onboarding and compliance guideline coding, saving time on more straightforward tasks to focus on complex, investigative tasks. Portfolio managers can access data, analytics, research summaries, cash balances and more through AI-powered chat capabilities; enabling faster, more informed decision-making aligned with client mandates. With accelerated insights, improved data quality and enhanced risk management, BlackRock and its clients gain an advantage while enhancing client service, compliance and portfolio management.
To build on its culture of innovation and enable hyper-relevant messaging at scale, multinational advertising and media agency dentsu built a cutting-edge solution using Azure OpenAI: dentsu.Connect — a unified OS for its applications. By leveraging the power of AI across the entire campaign lifecycle, clients can build and execute campaigns while predicting marketers’ next best impact with confidence and precision. This end-to-end platform drives data connectivity and ensures seamless interoperability with clients’ technology and data stacks to maximize and drive brand relevance across content, production and media activation while aligning every action with business goals. dentsu.Connect helps minimize the gap between insights and action with speed and precision. Since launching, users have increased operational efficiency by 25%, improved business outcomes by 30% and quickened decision-making and data-driven AI insight generation by 125X.
Water management solutions and services partner Ecolab is harnessing the power of data-driven solutions to enable organizations to reduce water consumption, maximize system performance and optimize operating costs. Using Microsoft Azure and IoT services, the company built ECOLAB3D: an intelligent cloud platform that unifies diverse and dispersed IoT data to visualize and optimize water systems remotely. By providing actionable insights for real-time optimization across multiple assets and sites, Ecolab partners with global leaders such as Microsoft to collectively drive hundreds of millions in operational savings — while conserving more than 226 billion gallons of water annually; equivalent to the drinking water needs of nearly 800 million people. Delivering solutions across diverse industries, Ecolab is also a trusted partner for foodservice locations, helping balance labor costs with customer satisfaction. Its cloud-based platform Ecolab RushReady transforms data into an AI-enabled dashboard that improves daily operations by delivering actionable insights. In an Ecolab customer case study, this helped improve speed of service and sales labor per hour, resulting in increased profit of more than 10%. From data centers to dining rooms, Ecolab delivers intelligent, scalable solutions that transform operations for greater efficiency and measurable impact.
Leveraging Microsoft’s AI solutions across its portfolio, Epic built agentic “personas” to support care teams and patients, improve operations and financial performance and advance the practice of medicine. By summarizing patient records and automatically drafting clinical notes, one organization found that “Art” decreased after-hours documentation for clinicians by 60%, reduced burnout by 82% and helped them focus more on patient care. Care teams can also track long-term patient health and better plan treatment for chronic conditions, while nurses can perform wound image analysis automatically with 72% greater precision than manual methods. At one hospital, AI review of routine chest X-rays led to earlier discovery of over 100 cases of lung cancer, increasing the detection rate to 70% compared to the 27% national average. To support back-end operations, organizations are using “Penny” to improve the revenue cycle — resulting in $3.4 million in additional revenue at one regional network services provider. Epic also developed “Emmie” to have conversational interactions with patients and more easily help them schedule appointments and ask questions. Epic is leveraging Azure Fabric for the Cosmos platform to bring together anonymized data from more than 300 million patients, including 13 million with rare diseases, so physicians can connect with peers who have treated similar cases to improve rare disease diagnosis and select the most effective treatment.
To reduce professional burnout and accelerate scale across the industry, Harvey built an AI platform to automate legal research, contract reviews and document analysis. Harvey Assistant assists attorney searches across large document sets to identify specific clauses or provisions within seconds instead of hours. To support large-scale analysis, Harvey Vault manages and analyzes up to 100,000 files per project for complex tasks like litigation, while Harvey Workflows automates routine yet critical tasks into smaller AI-managed steps. With the integration of the newly expanded Microsoft Word add-in, AI capabilities provide legal teams with the ability to edit 100-plus page documents with a single query, enabling centrally controlled document compliance reviews that enhance efficiency while reducing risk. With more than 74,000 legal professionals using the platform, Harvey is helping them streamline workflows, reduce administrative burden and combat attorney fatigue — with the average user saving up to 25 hours of time per month.
To revolutionize drug discovery, biotech company Insilico Medicine is leveraging AI across its entire development pipeline — from target identification to molecule design and clinical trials. The company created Pharma.AI to accelerate research while reducing costs and improving success rates in emerging novel therapies — with developmental candidate timelines reduced from 2.5-4.5 years to 9-18 months for more than 20 therapeutic programs. The integrated AI platforms built with Azure AI Foundry manage complex biological data, identify disease-relevant targets and advance candidates to clinical trials — accelerating research in what is traditionally a slow, costly and complex pharmaceutical R&D process. They enable researchers to analyze genetic data and identify drug targets with AI-generated reports to facilitate business case development; use physics-based models to evaluate candidates for potency, safety and synthesizability; integrate with specialized large language models for drug discovery; and combine AI agents with structured workflows to reduce document drafting time by over 85% while improving first-pass quality of scientific documents by 60%.
To enhance manufacturing operations in a fast-paced and complex industry, global consumer foods producer Kraft Heinz partnered with Microsoft to embed AI and machine learning across its production facilities, resulting in smarter decision-making and operational improvements. The company built an AI-powered platform — Plant Chat — providing real-time insights on the factory floor and reducing downtime to enable faster, more confident decision-making with proactive guidance. The solution analyzes over 300 variables and allows operators to interact via natural language to improve consistency, reduce guesswork, decrease waste and maintain compliance — even for less experienced operators. Since implementation and collectively with other initiatives, these efforts have resulted in a 40% reduction in supply-chain waste, a 20% increase in sales forecast accuracy and a 6% product-yield improvement across all North American manufacturing sites through the third quarter of 2024. Combined with further operational improvements, this work has yielded more than $1.1 billion in gross efficiencies from 2023 through the third quarter of 2024.
To redefine work and scale intelligent automation globally, digital native Manus AI developed an advanced autonomous AI system designed to understand user intent and execute complex workflows independently across various domains. The solution leverages a multi-agent architecture through Microsoft Azure AI Foundry to deliver scalable, versatile task automation for millions of users worldwide. Its Wide Research capability deploys specialized sub-agents to rapidly perform large-scale, multi-dimensional research tasks; saving significant time and delivering actionable insights to make complex analysis accessible and efficient for strategic decision-making. Manus AI can also build dynamic dashboards so organizations can visualize trends, anomalies and market insights in real-time; driving strategic planning with reliable, up-to-date information. The multimodel image editing and creation capabilities also allow users to support brand consistency and enable marketers and product teams to iterate rapidly.
To advance automotive innovation, stabilize supply chain volatility, simplify production complexity and meet sustainability demands, Mercedes-Benz scaled AI innovation across its global production network. The MO360 data platform connects over 30 car plants worldwide to the Microsoft Cloud, enabling real-time data access, global optimization and analytics. The Digital Factory Chatbot Ecosystem uses a multi-agent system to empower employees with collaborative insights, and Paint Shop AI leverages machine learning simulations to diagnose efficiency declines and reduce energy consumption of the buildings and machines — including 20% energy savings in the Rastatt paint shop. Using NVIDIA Omniverse on Azure, Mercedes-Benz created large-scale factory digital twins for visualization, testing and optimization of production lines — enabling agile planning and continuous improvement. The MBUX Virtual Assistant embedded in over 3 million vehicles, powered by Microsoft’s ChatGPT and Bing Search, offers natural, conversational voice interactions and integrates Microsoft 365 Copilot with Teams directly into vehicles to enable mobile workspaces.
U.S. stock exchange and financial services technology company Nasdaq integrated AI capabilities into its Nasdaq Boardvantage platform to help corporate governance teams and board members save time, reduce information overload, improve decision-making and enhance board meeting preparation and governance workflows. The board management platform is used by leadership teams at over 4,000 organizations worldwide to centralize activities like meeting planning, agenda building, decision support, resolution approval, voting and signatures. Using Azure OpenAI GPT-4o mini, the AI Summarization feature helps board secretaries significantly reduce manual effort, saving hundreds of hours annually with accuracy between 91% to 97%. AI Meeting Minutes helps governance teams draft minutes by processing agendas, documents and notes while allowing for customization of length, tone and anonymization; accelerating post-meeting workflows and saving up to five hours per meeting.
As customers seek to use AI more to shop and search for products, luxury lifestyle company Ralph Lauren developed a personal, frictionless, inspirational and accessible solution to blend fashion with cutting-edge AI. Working with Microsoft, Ralph Lauren developed Ask Ralph: an AI-powered conversational tool providing styling tips and outfit recommendations from across the Polo Ralph Lauren brand. Powered by Azure OpenAI, the AI tool uses a natural language search engine to adapt dynamically to specific language inputs and interpret user intent to improve accuracy. It supports complex queries with exploratory or nuanced information needs with contextual understanding; and can discern tone, satisfaction and intent to refine recommendations. The tool also picks up on cues like location-based insights or event-driven needs. With Ask Ralph, customers can now reimagine how they shop online by putting the brand’s unique and iconic take on style right into their own hands.
Industrial automation and digital transformation expert Rockwell Automation is integrating AI and advanced analytics into its products to help manufacturers adapt seamlessly to market changes, reduce risk and develop agentic AI capabilities to support innovation and growth. FactoryTalk Design Studio
Copilot, a cloud-based environment for programming, enables rapid updates to code for evolving production needs — reducing complex coding tasks from days to minutes. Rockwell’s digital twin software, Emulate3D®, creates physics-based models for virtual testing of automation code and AI, reducing costly real-world errors and production risks while cutting on-site commissioning times by 50%. With the integration of NVIDIA Omniverse — a collaborative, large-scale digital twin platform — users can perform multi-user factory design and testing to facilitate cross-disciplinary collaboration, address industry challenges and unlock opportunities through digital simulation before real-world deployment.
To enable a cleaner, more resilient energy future, Schneider Electric is powering AI-driven industry innovation by addressing grid stability and enterprise sustainability challenges. Built using Microsoft Azure, the company developed solutions for organizations to act faster and smarter while delivering measurable improvements in grid reliability and enterprise ESG management. Resource Advisor Copilot transforms raw ESG and energy data into actionable insights via natural language queries to support knowledge-based and system data questions; saving sustainability managers hundreds of hours annually in data analysis and reporting tasks in early testing. Grid AI Assistant allows operators to interact with complex grids using natural language to improve response times and accuracy during critical events; reducing outages by 40% and speeding up application deployment by 60%. Schneider Electric’s integration of AI tools reflects a strategic approach to digitally transforming energy management, addressing both operational resilience and sustainability imperatives.
To enhance personalized learning, streamline operations and support educators with innovative technology, the State of São Paulo’s Department of Education (SEDUC) partnered with Microsoft to equip schools with cloud and AI solutions — including Azure OpenAI, Microsoft 365, Azure and Dynamics 365. SEDUC is applying responsible AI solutions at scale to address sector priorities like delivering timely, high-quality formative feedback and reducing repetitive administrative work. With Essay Grader, teachers automate portions of grading and receive suggested feedback, freeing time for lesson design and individual support. With Question Grader, students can answer questions more openly with their own perspectives and reasoning while still receiving curated feedback typically reserved for extensive exams. By leveraging these AI-powered solutions, SEDUC is improving learning outcomes, boosting efficiency and strengthening teacher impact — anchored in equity, transparency and sound governance.
Australia’s leading telecommunications company, Telstra, is transforming its customer service operations to improve the experience for its customers and the people that serve them. One of the biggest pain points for teams is navigating multiple systems to identify and resolve a customer issue — leading to long handling times and reliance on how team members interpret various data sources. By leveraging AI solutions built on Azure OpenAI and Microsoft 365 Copilot, the company is enabling instant knowledge access and streamlined workflows. With One Sentence Summary, agents have a concise overview of customer interactions to improve efficiency and customer satisfaction — reducing call handling time by over one minute and repeat contacts by nearly 10%. Ask Telstra provides AI-generated responses from Telstra’s knowledge base in near real-time to assist agents with accurate product, plan and troubleshooting information across a wide variety of topics during calls; facilitating seamless agent-customer interactions with AI assistance.
As one of the largest leading global automakers, Toyota is pioneering AI intelligence in manufacturing with O-beya System: a multi-agent AI system simulating expert discussions virtually. Based on decades of engineering knowledge, the solution fosters a collaborative project management approach to enhance problem-solving and innovation in vehicle development while identifying key challenges to help analyze and diagnose problems. O-beya can auto-select AI agents in fields like fuel efficiency, drivability, noise and vibration, energy management and power management to pinpoint causes and suggest solutions. The system also offers interactive features; including prompt history, term explanations and creative summaries to further enable engineers to explore and validate mitigation strategies efficiently. The system leverages Microsoft Azure OpenAI, Azure AI Search and Azure Cosmos DB to analyze internal design data and help Toyota accelerate innovation, preserve institutional knowledge and resolve complex engineering issues faster. Since January 2024, over 800 powertrain engineers have accessed the system, utilizing it hundreds of times monthly across multiple business units.
As we seek to help our customers realize their AI ambitions, our mission remains unchanged: to empower every person and every organization on the planet to achieve more. We are at our best as a company when we put our technology to work for others. As you move forward on your AI journey, ask what AI can do for your organization and what it means to demand more from it. Leveraging the Microsoft portfolio, together we can do more to positively impact society; going beyond efficiency and productivity to solve for humanity’s biggest challenges. I look forward to partnering with you on your path to becoming Frontier.
The post Becoming Frontier: How human ambition and AI-first differentiation are helping Microsoft customers go further with AI appeared first on The Official Microsoft Blog.
Over the past few years, we have driven remarkable progress accelerating AI innovation together with our customers and partners. We are achieving efficiency and productivity at scale to shape industries and markets around the world. It is time to demand more of AI to solve humanity’s biggest challenges by democratizing intelligence, obsolescing the mundane and…
The post Becoming Frontier: How human ambition and AI-first differentiation are helping Microsoft customers go further with AI appeared first on The Official Microsoft Blog.Read More
Discrepancy in sparse matrix math, when NaN’s present
I expect result1 and result2 below to be identical, but they aren’t. The discrepancy must be a bug, right? I’m working in R2024b, but the Run output below shows the issue exists as well in whatever the Matlab online engine is now running.
n = 5; m = 3;
S = sparse(n, m);
v=nan(n, 1);
D=sparse(diag(v));
result1=full(v.*S) %correct
result2=full(D*S) %incorrectI expect result1 and result2 below to be identical, but they aren’t. The discrepancy must be a bug, right? I’m working in R2024b, but the Run output below shows the issue exists as well in whatever the Matlab online engine is now running.
n = 5; m = 3;
S = sparse(n, m);
v=nan(n, 1);
D=sparse(diag(v));
result1=full(v.*S) %correct
result2=full(D*S) %incorrect I expect result1 and result2 below to be identical, but they aren’t. The discrepancy must be a bug, right? I’m working in R2024b, but the Run output below shows the issue exists as well in whatever the Matlab online engine is now running.
n = 5; m = 3;
S = sparse(n, m);
v=nan(n, 1);
D=sparse(diag(v));
result1=full(v.*S) %correct
result2=full(D*S) %incorrect sparse, nan, bug?, numeric MATLAB Answers — New Questions









