Category: News
How can I build and run a .NET Project using MATLAB Compiler SDK .NET Data API Assemblies from WSL?
I have a .NET Project on my Windows machine that uses MATLAB Compiler SDK .NET Data API assemblies, and I want to try building and running the project through Windows Subsystem for Linux (WSL) on the same machine. Is this possible? How can I do this?I have a .NET Project on my Windows machine that uses MATLAB Compiler SDK .NET Data API assemblies, and I want to try building and running the project through Windows Subsystem for Linux (WSL) on the same machine. Is this possible? How can I do this? I have a .NET Project on my Windows machine that uses MATLAB Compiler SDK .NET Data API assemblies, and I want to try building and running the project through Windows Subsystem for Linux (WSL) on the same machine. Is this possible? How can I do this? .net, data, api, wsl, windows, linux, subsystem, compiler, assemblies MATLAB Answers — New Questions
Search-UnifiedAuditLog Updated to Make Large Searches Easier to Manage
New MoreRecordsAvailable Property Helps When Retrieving Large Numbers of Audit Records
Message center MC1310672 (14 May 2026) reveals a change to the way that the Search-UnifiedAuditLog cmdlet works. The change is rolling out and should be complete for worldwide commercial tenants by the end of May 2026. It’s already active in my tenant. Government cloud tenants will see the change in June 2026.
As you probably know, Search-UnifiedAuditLog is the cmdlet used to run synchronous audit log searches. A synchronous search can return a maximum of 50,000 audit records using the SessionCommand parameter to control pagination (fetching of up to 5,000 records at a time). If you need to fetch more than 50,000 audit records, use the Graph AuditLogQuery API. Although Microsoft has struggled to improve the stability and performance of the API to meet the bar for general availability, I’ve still been able to fetch nearly half a million audit records with an asynchronous audit search.
Ingesting Audit Data
Many Microsoft 365 tenants ingest audit log data into Microsoft Sentinel using the Office 365 Connector for long-term storage and better search facilities. Others export audit records to external repositories like Splunk. In these scenarios, PowerShell scripts are often used to run Search-UnifiedAuditLog to fetch audit log data that’s later processed to insert the audit data into the target repository. If your tenant does this kind of processing, you should review the change to figure out if your script code requires an update.
Tracking the Progress of Audit Log Searches
Until this change, the ResultCount property in audit log records returned by Search-UnifiedAuditLog indicated the total number of results expected from a search. Now, ResultCount holds the running count of results which is updated as the search retrieves audit records. In a nutshell, if a script depends on ResultCount to tell it how many items a search fetches, that information is now no longer valid.
To track the progress of audit log searches, scripts should now use the new AuditSearchRequestMetadata.moreRecordsAvailable property. The property is false if no further audit records are available that match the search criteria. If true, you know that all matching records have been fetched.
Microsoft says that the change improves performance and delivers better visibility into search progress. I don’t know. The cmdlet seems to be as slow as it ever was. The assertion about better visibility is, I guess, justified because a specific property is now available to indicate if additional records are available.
Testing Search-UnifiedAuditLog with Large Searches
To test how the MoreRecordsAvailable property works, I wrote some code to perform a large audit log search using the SessionCommand parameter. Basically, the code fetches pages of 5,000 audit records until no more are available up to the documented maximum of 50,000 records. The MoreRecordsAvailable property is used to break out of the loop when no more records are available.
$AllRecords = @()
$SessionId = [guid]::NewGuid()
[int]$i = 0
$StartDate = (Get-Date).AddDays(-10)
$EndDate = Get-Date
Do {
$i++
Write-Host "page " $i
[array]$Records = Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate -SessionId $SessionId -SessionCommand ReturnLargeSet -ResultSize 5000
If ($Records) {
# Add the set to the overall array of audit records fetched by the search
$AllRecords += $Records
Write-Host ("{0} audit records found so far…" -f $AllRecords.count)
# Any more records?
$More = ($Records[0].AuditSearchRequestMetadata | ConvertFrom-Json).moreRecordsAvailable
} Else {
$More = $false
}
} While ($More -eq $true -and $AllRecords.count -le 50000)
# Make sure records are deduplicated and sorted in date order
$AllRecords = $AllRecords | Sort-Object Identity -Unique | Sort-Object {$_.CreationDate -as [datetime]}
Write-Host ("All done {0} records found in {1} minutes." -f $AllRecords.Count, [math]::Round((New-TimeSpan -Start $EndDate).TotalMinutes,3))
Interestingly, when testing the code, it retrieved 54,127 records (Figure 1), which is more than the documented limit. After deduplication, which is needed because audit log searches return duplicates for a variety of reasons, the number reduced to 48,541. Each record has a unique identifier, so sorting by the identifier is a simple way to remove duplicates.

You should stay within the 50,000 limit to make sure that searches run smoothly. If needed, split searches into multiple jobs (separate sessions) to fetch all available records.
Here is the first record in the returned set. You can see that MoreRecordsAvailable is true.
CreationDate : 04/05/2026 00:12:44
ResultIndex : 1
ResultCount : 5752
AuditSearchRequestMetadata : {
"moreRecordsAvailable": true
}
Identity : 99899933-91ac-43f6-c7ae-08dea7165e54
When the last record is checked, MoreRecordsAavailable is false:
CreationDate : 14/05/2026 23:22:01
ResultIndex : 5752
ResultCount : 5752
AuditSearchRequestMetadata : {
"moreRecordsAvailable": false
}
Identity : aff287f5-2c78-4821-a994-97239981fc55
If MoreRecordsAvailable is true for the last record in the set, it means that the search was not able to retrieve all matching records. For example, if you run a search that finds more than the 50,000 limit, the cmdlet cannot retrieve all available records and MoreRecordsAvailable will be true. That’s a strong sign that you need to split retrieval across multiple searches.
First exposure to the new property indicates that the MoreRecordsAvailable property should be useful in specific circumstances. It won’t cure some of the other ailments of the audit system, but it is an improvement, and for that I am thankful
Why isnt the mathworks course task not acceptig my answer?
I need to finish the control system analysis course for a class and the first coding task isnt being accepted by matlab i font understand why i need this to workI need to finish the control system analysis course for a class and the first coding task isnt being accepted by matlab i font understand why i need this to work I need to finish the control system analysis course for a class and the first coding task isnt being accepted by matlab i font understand why i need this to work self-paced course MATLAB Answers — New Questions
Color inside Confidence Interval after a fitlm
Hi
I’d like to color the area in betwen the Confidence Interval after a fitlm, like shown in the attached pic
I tried patch, area, fill, but I couln’t make any of them work.
I think the issue is that the x values are not continuous (it’s not 1:19 for example)
I have 2 continuous variables
% x = rand(1,19); y = x+[1:19];
d = load(‘d.txt’) ;
x = d(:,1) ;
y = d(:,2) ;
mdl = fitlm(x,y)
mdl.plot
thanks a lotHi
I’d like to color the area in betwen the Confidence Interval after a fitlm, like shown in the attached pic
I tried patch, area, fill, but I couln’t make any of them work.
I think the issue is that the x values are not continuous (it’s not 1:19 for example)
I have 2 continuous variables
% x = rand(1,19); y = x+[1:19];
d = load(‘d.txt’) ;
x = d(:,1) ;
y = d(:,2) ;
mdl = fitlm(x,y)
mdl.plot
thanks a lot Hi
I’d like to color the area in betwen the Confidence Interval after a fitlm, like shown in the attached pic
I tried patch, area, fill, but I couln’t make any of them work.
I think the issue is that the x values are not continuous (it’s not 1:19 for example)
I have 2 continuous variables
% x = rand(1,19); y = x+[1:19];
d = load(‘d.txt’) ;
x = d(:,1) ;
y = d(:,2) ;
mdl = fitlm(x,y)
mdl.plot
thanks a lot area color, fitlm, confidence interval MATLAB Answers — New Questions
Computing the standard errors
Dear all,
for my master’s thesis, I have to compute the standard errors of the estimated model parameters using a bootstrap approach. Trying to run the file "booti2.m", I obtain the following error:
>> booti2
Index exceeds the number of array elements. Index must not exceed 19.
Error in llfn (line 61)
sigvtr = bigthet(20);
^^^^^^^^^^^
Error in
fminunc (line 233)
f = feval(funfcn{3},x,varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
booti2 (line 87)
[thetstar,fstar,exitflag] = fminunc(@llfn,bigtheto,options);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Failure in initial objective function evaluation. FMINUNC cannot continue.
>>
Please note, that before I could run the original "booti.m" file with data for France successfully, while now I can’t run neither Slovenian nor French file. Thank you so much! Meancimpr.DAT file is in the folder Searching for Starting Values – Full SampleDear all,
for my master’s thesis, I have to compute the standard errors of the estimated model parameters using a bootstrap approach. Trying to run the file "booti2.m", I obtain the following error:
>> booti2
Index exceeds the number of array elements. Index must not exceed 19.
Error in llfn (line 61)
sigvtr = bigthet(20);
^^^^^^^^^^^
Error in
fminunc (line 233)
f = feval(funfcn{3},x,varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
booti2 (line 87)
[thetstar,fstar,exitflag] = fminunc(@llfn,bigtheto,options);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Failure in initial objective function evaluation. FMINUNC cannot continue.
>>
Please note, that before I could run the original "booti.m" file with data for France successfully, while now I can’t run neither Slovenian nor French file. Thank you so much! Meancimpr.DAT file is in the folder Searching for Starting Values – Full Sample Dear all,
for my master’s thesis, I have to compute the standard errors of the estimated model parameters using a bootstrap approach. Trying to run the file "booti2.m", I obtain the following error:
>> booti2
Index exceeds the number of array elements. Index must not exceed 19.
Error in llfn (line 61)
sigvtr = bigthet(20);
^^^^^^^^^^^
Error in
fminunc (line 233)
f = feval(funfcn{3},x,varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
booti2 (line 87)
[thetstar,fstar,exitflag] = fminunc(@llfn,bigtheto,options);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Failure in initial objective function evaluation. FMINUNC cannot continue.
>>
Please note, that before I could run the original "booti.m" file with data for France successfully, while now I can’t run neither Slovenian nor French file. Thank you so much! Meancimpr.DAT file is in the folder Searching for Starting Values – Full Sample standard errors MATLAB Answers — New Questions
Need assistance for parrot minidrone controller in simulink (mostly about a quaternion based attitude estimator)
Hello,
I’m a mechanical engineer student and I’m doing a school project. I need to make a controller for a drone in simulink. My task right now is to build a quaternion based estimator for the attitude.
I’ve done multiple tries implementing EKFs and a complementary filters but for now nothing seems to work as it should for now.
Prior to this project I had no experience in this subject, so I had to learn it all by myself for now. The assistance we have for this project at my school is basically useless, so I’m writting here to see if someone have any experience in that and would be willing to help me.
I tried to attach the project folder but it’s too big so if you’re willing to help me and have some experience please reach out to me !
julien.berset@epfl.ch
thanks !Hello,
I’m a mechanical engineer student and I’m doing a school project. I need to make a controller for a drone in simulink. My task right now is to build a quaternion based estimator for the attitude.
I’ve done multiple tries implementing EKFs and a complementary filters but for now nothing seems to work as it should for now.
Prior to this project I had no experience in this subject, so I had to learn it all by myself for now. The assistance we have for this project at my school is basically useless, so I’m writting here to see if someone have any experience in that and would be willing to help me.
I tried to attach the project folder but it’s too big so if you’re willing to help me and have some experience please reach out to me !
julien.berset@epfl.ch
thanks ! Hello,
I’m a mechanical engineer student and I’m doing a school project. I need to make a controller for a drone in simulink. My task right now is to build a quaternion based estimator for the attitude.
I’ve done multiple tries implementing EKFs and a complementary filters but for now nothing seems to work as it should for now.
Prior to this project I had no experience in this subject, so I had to learn it all by myself for now. The assistance we have for this project at my school is basically useless, so I’m writting here to see if someone have any experience in that and would be willing to help me.
I tried to attach the project folder but it’s too big so if you’re willing to help me and have some experience please reach out to me !
julien.berset@epfl.ch
thanks ! drone controller, simulink, quaternions, attitude MATLAB Answers — New Questions
Cone angle of spray
Hello to everybody,
I want to calculate spray angle of this image and i use this code (that I found here) but this code evaluates an angle of 0 degrees. Can someone help me???? This is the final image
function test
clc;
close all;
workspace; % Make sure the workspace panel with all the variables is showing.
format longg;
format compact;
fontSize = 18;
% Check that user has the Image Processing Toolbox installed.
hasIPT = license(‘test’, ‘image_toolbox’);
if ~hasIPT
% User does not have the toolbox installed.
message = sprintf(‘Sorry, but you do not seem to have the Image Processing Toolbox.nDo you want to try to continue anyway?’);
reply = questdlg(message, ‘Toolbox missing’, ‘Yes’, ‘No’, ‘Yes’);
if strcmpi(reply, ‘No’)
% User said No, so exit.
return;
end
end
%===============================================================================
% Read in a standard MATLAB color demo image.
folder = pwd;
baseFileName = ‘prova.jpg’;
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, ‘file’)
% Didn’t find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, ‘file’)
% Still didn’t find it. Alert user.
errorMessage = sprintf(‘Error: %s does not exist.’, fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
grayImage = imread(fullFileName);
% Get the dimensions of the image. numberOfColorBands should be = 3.
[rows, columns, numberOfColorBands] = size(grayImage);
if numberOfColorBands > 1
% If it’s really color, then convert to gray scale.
grayImage = grayImage(:,:,2);
end
% Display the original image.
subplot(2, 3, 1);
imshow(grayImage);
axis on;
title(‘Original Image’, ‘FontSize’, fontSize);
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘Outerposition’, [0, 0, 1, 1]);
% Let’s compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
% Suppress bins at 0 and 255 because they’re so tall we can’t see the rest of it.
pixelCount(1) = 0;
pixelCount(end) = 0;
subplot(2, 3, 2);
bar(grayLevels, pixelCount);
grid on;
title(‘Histogram of original image’, ‘FontSize’, fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
% [lowThreshold, highThreshold, lastThresholdedBand] = threshold(133, 255, grayImage);
% Threshold the image
thresholdValue = 50;
binaryImage = grayImage < thresholdValue;
% Fill holes
% binaryImage = imfill(binaryImage, ‘holes’);
% Display the image.
subplot(2, 3, 3);
imshow(binaryImage);
axis on;
title(‘Binary Image’, ‘FontSize’, fontSize);
%—————————————————————————
% Extract the largest area using our custom function ExtractNLargestBlobs().
numberToExtract = 1;
binaryImage = ExtractNLargestBlobs(binaryImage, numberToExtract);
%—————————————————————————
% % Fill any holes that might be present
binaryImage = imfill(binaryImage, ‘holes’);
% Do an opening to smooth out the edges.
se = strel(‘disk’, 3, 0);
binaryImage = imopen(binaryImage, se);
% Display the image.
subplot(2, 3, 4);
imshow(binaryImage);
axis on;
title(‘Biggest Blob’, ‘FontSize’, fontSize);
drawnow;
% Go down the image line by line finding the width
widths = zeros(1, rows);
leftEdge = zeros(1, rows);
rightEdge = zeros(1, rows);
for row = 1 : rows
thisRow = binaryImage(row, :);
leftIndex = find(thisRow, 1, ‘first’);
if ~isempty(leftIndex)
% There’s something there
leftEdge(row) = leftIndex;
rightEdge(row) = find(thisRow, 1, ‘last’);
widths(row) = rightEdge(row) – leftEdge(row);
end
end
% plot the widths
subplot(2, 3, 5);
plot(1:rows, widths, ‘b-‘, ‘LineWidth’, 2);
grid on;
title(‘Widths as a function of line number’, ‘FontSize’, fontSize);
axis on;
% Now find min width at top and max width.
% This could be an algorithm all by itself, but since this is just a simple demo,
% I’m going to hard code in values that I can see from the plot of the widths.
% I’m going to fit between rows 10 and 60
x = 10:60;
% Get the left angle.
y = leftEdge(x);
leftCoefficients = polyfit(x, y, 1);
leftAngle = atand(leftCoefficients(1))
subplot(2, 3, 6);
plot(x, y, ‘b-‘, ‘LineWidth’, 2);
hold on;
y = rightEdge(x);
rightCoefficients = polyfit(x, y, 1);
rightAngle = atand(rightCoefficients(1))
plot(x, y, ‘r-‘, ‘LineWidth’, 2);
grid on;
coneAngle = abs(leftAngle) + abs(rightAngle);
% Plot the fitted lines
yLeftFit = polyval(leftCoefficients, x);
plot(x, yLeftFit, ‘b-‘, ‘LineWidth’, 2);
yRightFit = polyval(rightCoefficients, x);
plot(x, yRightFit, ‘r-‘, ‘LineWidth’, 2);
legend(‘left’, ‘right’, ‘Location’, ‘east’);
message = sprintf(‘Done with demo.nThe cone angle is %.1f degrees.’, coneAngle);
uiwait(helpdlg(message));
%==============================================================================================
% Function to return the specified number of largest or smallest blobs in a binary image.
% If numberToExtract > 0 it returns the numberToExtract largest blobs.
% If numberToExtract < 0 it returns the numberToExtract smallest blobs.
% Example: return a binary image with only the largest blob:
% binaryImage = ExtractNLargestBlobs(binaryImage, 1);
% Example: return a binary image with the 3 smallest blobs:
% binaryImage = ExtractNLargestBlobs(binaryImage, -3);
function binaryImage = ExtractNLargestBlobs(binaryImage, numberToExtract)
try
% Get all the blob properties. Can only pass in originalImage in version R2008a and later.
[labeledImage, numberOfBlobs] = bwlabel(binaryImage);
blobMeasurements = regionprops(labeledImage, ‘area’);
% Get all the areas
allAreas = [blobMeasurements.Area];
if numberToExtract > length(allAreas);
% Limit the number they can get to the number that are there/available.
numberToExtract = length(allAreas);
end
if numberToExtract > 0
% For positive numbers, sort in order of largest to smallest.
% Sort them.
[sortedAreas, sortIndexes] = sort(allAreas, ‘descend’);
elseif numberToExtract < 0
% For negative numbers, sort in order of smallest to largest.
% Sort them.
[sortedAreas, sortIndexes] = sort(allAreas, ‘ascend’);
% Need to negate numberToExtract so we can use it in sortIndexes later.
numberToExtract = -numberToExtract;
else
% numberToExtract = 0. Shouldn’t happen. Return no blobs.
binaryImage = false(size(binaryImage));
return;
end
% Extract the "numberToExtract" largest blob(a)s using ismember().
biggestBlob = ismember(labeledImage, sortIndexes(1:numberToExtract));
% Convert from integer labeled image into binary (logical) image.
binaryImage = biggestBlob > 0;
catch ME
errorMessage = sprintf(‘Error in function ExtractNLargestBlobs().nnError Message:n%s’, ME.message);
fprintf(1, ‘%sn’, errorMessage);
uiwait(warndlg(errorMessage));
endHello to everybody,
I want to calculate spray angle of this image and i use this code (that I found here) but this code evaluates an angle of 0 degrees. Can someone help me???? This is the final image
function test
clc;
close all;
workspace; % Make sure the workspace panel with all the variables is showing.
format longg;
format compact;
fontSize = 18;
% Check that user has the Image Processing Toolbox installed.
hasIPT = license(‘test’, ‘image_toolbox’);
if ~hasIPT
% User does not have the toolbox installed.
message = sprintf(‘Sorry, but you do not seem to have the Image Processing Toolbox.nDo you want to try to continue anyway?’);
reply = questdlg(message, ‘Toolbox missing’, ‘Yes’, ‘No’, ‘Yes’);
if strcmpi(reply, ‘No’)
% User said No, so exit.
return;
end
end
%===============================================================================
% Read in a standard MATLAB color demo image.
folder = pwd;
baseFileName = ‘prova.jpg’;
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, ‘file’)
% Didn’t find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, ‘file’)
% Still didn’t find it. Alert user.
errorMessage = sprintf(‘Error: %s does not exist.’, fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
grayImage = imread(fullFileName);
% Get the dimensions of the image. numberOfColorBands should be = 3.
[rows, columns, numberOfColorBands] = size(grayImage);
if numberOfColorBands > 1
% If it’s really color, then convert to gray scale.
grayImage = grayImage(:,:,2);
end
% Display the original image.
subplot(2, 3, 1);
imshow(grayImage);
axis on;
title(‘Original Image’, ‘FontSize’, fontSize);
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘Outerposition’, [0, 0, 1, 1]);
% Let’s compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
% Suppress bins at 0 and 255 because they’re so tall we can’t see the rest of it.
pixelCount(1) = 0;
pixelCount(end) = 0;
subplot(2, 3, 2);
bar(grayLevels, pixelCount);
grid on;
title(‘Histogram of original image’, ‘FontSize’, fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
% [lowThreshold, highThreshold, lastThresholdedBand] = threshold(133, 255, grayImage);
% Threshold the image
thresholdValue = 50;
binaryImage = grayImage < thresholdValue;
% Fill holes
% binaryImage = imfill(binaryImage, ‘holes’);
% Display the image.
subplot(2, 3, 3);
imshow(binaryImage);
axis on;
title(‘Binary Image’, ‘FontSize’, fontSize);
%—————————————————————————
% Extract the largest area using our custom function ExtractNLargestBlobs().
numberToExtract = 1;
binaryImage = ExtractNLargestBlobs(binaryImage, numberToExtract);
%—————————————————————————
% % Fill any holes that might be present
binaryImage = imfill(binaryImage, ‘holes’);
% Do an opening to smooth out the edges.
se = strel(‘disk’, 3, 0);
binaryImage = imopen(binaryImage, se);
% Display the image.
subplot(2, 3, 4);
imshow(binaryImage);
axis on;
title(‘Biggest Blob’, ‘FontSize’, fontSize);
drawnow;
% Go down the image line by line finding the width
widths = zeros(1, rows);
leftEdge = zeros(1, rows);
rightEdge = zeros(1, rows);
for row = 1 : rows
thisRow = binaryImage(row, :);
leftIndex = find(thisRow, 1, ‘first’);
if ~isempty(leftIndex)
% There’s something there
leftEdge(row) = leftIndex;
rightEdge(row) = find(thisRow, 1, ‘last’);
widths(row) = rightEdge(row) – leftEdge(row);
end
end
% plot the widths
subplot(2, 3, 5);
plot(1:rows, widths, ‘b-‘, ‘LineWidth’, 2);
grid on;
title(‘Widths as a function of line number’, ‘FontSize’, fontSize);
axis on;
% Now find min width at top and max width.
% This could be an algorithm all by itself, but since this is just a simple demo,
% I’m going to hard code in values that I can see from the plot of the widths.
% I’m going to fit between rows 10 and 60
x = 10:60;
% Get the left angle.
y = leftEdge(x);
leftCoefficients = polyfit(x, y, 1);
leftAngle = atand(leftCoefficients(1))
subplot(2, 3, 6);
plot(x, y, ‘b-‘, ‘LineWidth’, 2);
hold on;
y = rightEdge(x);
rightCoefficients = polyfit(x, y, 1);
rightAngle = atand(rightCoefficients(1))
plot(x, y, ‘r-‘, ‘LineWidth’, 2);
grid on;
coneAngle = abs(leftAngle) + abs(rightAngle);
% Plot the fitted lines
yLeftFit = polyval(leftCoefficients, x);
plot(x, yLeftFit, ‘b-‘, ‘LineWidth’, 2);
yRightFit = polyval(rightCoefficients, x);
plot(x, yRightFit, ‘r-‘, ‘LineWidth’, 2);
legend(‘left’, ‘right’, ‘Location’, ‘east’);
message = sprintf(‘Done with demo.nThe cone angle is %.1f degrees.’, coneAngle);
uiwait(helpdlg(message));
%==============================================================================================
% Function to return the specified number of largest or smallest blobs in a binary image.
% If numberToExtract > 0 it returns the numberToExtract largest blobs.
% If numberToExtract < 0 it returns the numberToExtract smallest blobs.
% Example: return a binary image with only the largest blob:
% binaryImage = ExtractNLargestBlobs(binaryImage, 1);
% Example: return a binary image with the 3 smallest blobs:
% binaryImage = ExtractNLargestBlobs(binaryImage, -3);
function binaryImage = ExtractNLargestBlobs(binaryImage, numberToExtract)
try
% Get all the blob properties. Can only pass in originalImage in version R2008a and later.
[labeledImage, numberOfBlobs] = bwlabel(binaryImage);
blobMeasurements = regionprops(labeledImage, ‘area’);
% Get all the areas
allAreas = [blobMeasurements.Area];
if numberToExtract > length(allAreas);
% Limit the number they can get to the number that are there/available.
numberToExtract = length(allAreas);
end
if numberToExtract > 0
% For positive numbers, sort in order of largest to smallest.
% Sort them.
[sortedAreas, sortIndexes] = sort(allAreas, ‘descend’);
elseif numberToExtract < 0
% For negative numbers, sort in order of smallest to largest.
% Sort them.
[sortedAreas, sortIndexes] = sort(allAreas, ‘ascend’);
% Need to negate numberToExtract so we can use it in sortIndexes later.
numberToExtract = -numberToExtract;
else
% numberToExtract = 0. Shouldn’t happen. Return no blobs.
binaryImage = false(size(binaryImage));
return;
end
% Extract the "numberToExtract" largest blob(a)s using ismember().
biggestBlob = ismember(labeledImage, sortIndexes(1:numberToExtract));
% Convert from integer labeled image into binary (logical) image.
binaryImage = biggestBlob > 0;
catch ME
errorMessage = sprintf(‘Error in function ExtractNLargestBlobs().nnError Message:n%s’, ME.message);
fprintf(1, ‘%sn’, errorMessage);
uiwait(warndlg(errorMessage));
end Hello to everybody,
I want to calculate spray angle of this image and i use this code (that I found here) but this code evaluates an angle of 0 degrees. Can someone help me???? This is the final image
function test
clc;
close all;
workspace; % Make sure the workspace panel with all the variables is showing.
format longg;
format compact;
fontSize = 18;
% Check that user has the Image Processing Toolbox installed.
hasIPT = license(‘test’, ‘image_toolbox’);
if ~hasIPT
% User does not have the toolbox installed.
message = sprintf(‘Sorry, but you do not seem to have the Image Processing Toolbox.nDo you want to try to continue anyway?’);
reply = questdlg(message, ‘Toolbox missing’, ‘Yes’, ‘No’, ‘Yes’);
if strcmpi(reply, ‘No’)
% User said No, so exit.
return;
end
end
%===============================================================================
% Read in a standard MATLAB color demo image.
folder = pwd;
baseFileName = ‘prova.jpg’;
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, ‘file’)
% Didn’t find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, ‘file’)
% Still didn’t find it. Alert user.
errorMessage = sprintf(‘Error: %s does not exist.’, fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
grayImage = imread(fullFileName);
% Get the dimensions of the image. numberOfColorBands should be = 3.
[rows, columns, numberOfColorBands] = size(grayImage);
if numberOfColorBands > 1
% If it’s really color, then convert to gray scale.
grayImage = grayImage(:,:,2);
end
% Display the original image.
subplot(2, 3, 1);
imshow(grayImage);
axis on;
title(‘Original Image’, ‘FontSize’, fontSize);
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘Outerposition’, [0, 0, 1, 1]);
% Let’s compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
% Suppress bins at 0 and 255 because they’re so tall we can’t see the rest of it.
pixelCount(1) = 0;
pixelCount(end) = 0;
subplot(2, 3, 2);
bar(grayLevels, pixelCount);
grid on;
title(‘Histogram of original image’, ‘FontSize’, fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
% [lowThreshold, highThreshold, lastThresholdedBand] = threshold(133, 255, grayImage);
% Threshold the image
thresholdValue = 50;
binaryImage = grayImage < thresholdValue;
% Fill holes
% binaryImage = imfill(binaryImage, ‘holes’);
% Display the image.
subplot(2, 3, 3);
imshow(binaryImage);
axis on;
title(‘Binary Image’, ‘FontSize’, fontSize);
%—————————————————————————
% Extract the largest area using our custom function ExtractNLargestBlobs().
numberToExtract = 1;
binaryImage = ExtractNLargestBlobs(binaryImage, numberToExtract);
%—————————————————————————
% % Fill any holes that might be present
binaryImage = imfill(binaryImage, ‘holes’);
% Do an opening to smooth out the edges.
se = strel(‘disk’, 3, 0);
binaryImage = imopen(binaryImage, se);
% Display the image.
subplot(2, 3, 4);
imshow(binaryImage);
axis on;
title(‘Biggest Blob’, ‘FontSize’, fontSize);
drawnow;
% Go down the image line by line finding the width
widths = zeros(1, rows);
leftEdge = zeros(1, rows);
rightEdge = zeros(1, rows);
for row = 1 : rows
thisRow = binaryImage(row, :);
leftIndex = find(thisRow, 1, ‘first’);
if ~isempty(leftIndex)
% There’s something there
leftEdge(row) = leftIndex;
rightEdge(row) = find(thisRow, 1, ‘last’);
widths(row) = rightEdge(row) – leftEdge(row);
end
end
% plot the widths
subplot(2, 3, 5);
plot(1:rows, widths, ‘b-‘, ‘LineWidth’, 2);
grid on;
title(‘Widths as a function of line number’, ‘FontSize’, fontSize);
axis on;
% Now find min width at top and max width.
% This could be an algorithm all by itself, but since this is just a simple demo,
% I’m going to hard code in values that I can see from the plot of the widths.
% I’m going to fit between rows 10 and 60
x = 10:60;
% Get the left angle.
y = leftEdge(x);
leftCoefficients = polyfit(x, y, 1);
leftAngle = atand(leftCoefficients(1))
subplot(2, 3, 6);
plot(x, y, ‘b-‘, ‘LineWidth’, 2);
hold on;
y = rightEdge(x);
rightCoefficients = polyfit(x, y, 1);
rightAngle = atand(rightCoefficients(1))
plot(x, y, ‘r-‘, ‘LineWidth’, 2);
grid on;
coneAngle = abs(leftAngle) + abs(rightAngle);
% Plot the fitted lines
yLeftFit = polyval(leftCoefficients, x);
plot(x, yLeftFit, ‘b-‘, ‘LineWidth’, 2);
yRightFit = polyval(rightCoefficients, x);
plot(x, yRightFit, ‘r-‘, ‘LineWidth’, 2);
legend(‘left’, ‘right’, ‘Location’, ‘east’);
message = sprintf(‘Done with demo.nThe cone angle is %.1f degrees.’, coneAngle);
uiwait(helpdlg(message));
%==============================================================================================
% Function to return the specified number of largest or smallest blobs in a binary image.
% If numberToExtract > 0 it returns the numberToExtract largest blobs.
% If numberToExtract < 0 it returns the numberToExtract smallest blobs.
% Example: return a binary image with only the largest blob:
% binaryImage = ExtractNLargestBlobs(binaryImage, 1);
% Example: return a binary image with the 3 smallest blobs:
% binaryImage = ExtractNLargestBlobs(binaryImage, -3);
function binaryImage = ExtractNLargestBlobs(binaryImage, numberToExtract)
try
% Get all the blob properties. Can only pass in originalImage in version R2008a and later.
[labeledImage, numberOfBlobs] = bwlabel(binaryImage);
blobMeasurements = regionprops(labeledImage, ‘area’);
% Get all the areas
allAreas = [blobMeasurements.Area];
if numberToExtract > length(allAreas);
% Limit the number they can get to the number that are there/available.
numberToExtract = length(allAreas);
end
if numberToExtract > 0
% For positive numbers, sort in order of largest to smallest.
% Sort them.
[sortedAreas, sortIndexes] = sort(allAreas, ‘descend’);
elseif numberToExtract < 0
% For negative numbers, sort in order of smallest to largest.
% Sort them.
[sortedAreas, sortIndexes] = sort(allAreas, ‘ascend’);
% Need to negate numberToExtract so we can use it in sortIndexes later.
numberToExtract = -numberToExtract;
else
% numberToExtract = 0. Shouldn’t happen. Return no blobs.
binaryImage = false(size(binaryImage));
return;
end
% Extract the "numberToExtract" largest blob(a)s using ismember().
biggestBlob = ismember(labeledImage, sortIndexes(1:numberToExtract));
% Convert from integer labeled image into binary (logical) image.
binaryImage = biggestBlob > 0;
catch ME
errorMessage = sprintf(‘Error in function ExtractNLargestBlobs().nnError Message:n%s’, ME.message);
fprintf(1, ‘%sn’, errorMessage);
uiwait(warndlg(errorMessage));
end angle, spray, cone angle, angle spray, spray angle, spray cone MATLAB Answers — New Questions
How to download R2016a version of matlab.
How to download R2016a version of matlab,When i try to download it, it is asking for license key or activation key.i already have R2010b installed on my system.when i enter license key it is saying u entered invalid key.Please tell how to download latest version of matlabHow to download R2016a version of matlab,When i try to download it, it is asking for license key or activation key.i already have R2010b installed on my system.when i enter license key it is saying u entered invalid key.Please tell how to download latest version of matlab How to download R2016a version of matlab,When i try to download it, it is asking for license key or activation key.i already have R2010b installed on my system.when i enter license key it is saying u entered invalid key.Please tell how to download latest version of matlab download matlab MATLAB Answers — New Questions
Licensing Error 5005: “You do not have a valid license file” on R2026a startup.
Hello, I am unable to launch MATLAB R2026a due to Licensing Error 5005.
Steps I have already taken:
Attempted manual activation using activate_matlab.exe as Administrator.
Performed a clean reinstall, manually deleting the following folders:
C:Program FilesMATLABR2026a
C:UsersdanieAppDataRoamingMathWorks
I noticed a ghost entry for a previous version (R2022a) in Windows Settings that points to a non-existent path on the Desktop, which I cannot remove.
Checked the licenses folder; it was empty or contained a file that didn’t resolve the issue.
I have attached a screenshot of the error message. How can I force MATLAB to recognize my valid license?Hello, I am unable to launch MATLAB R2026a due to Licensing Error 5005.
Steps I have already taken:
Attempted manual activation using activate_matlab.exe as Administrator.
Performed a clean reinstall, manually deleting the following folders:
C:Program FilesMATLABR2026a
C:UsersdanieAppDataRoamingMathWorks
I noticed a ghost entry for a previous version (R2022a) in Windows Settings that points to a non-existent path on the Desktop, which I cannot remove.
Checked the licenses folder; it was empty or contained a file that didn’t resolve the issue.
I have attached a screenshot of the error message. How can I force MATLAB to recognize my valid license? Hello, I am unable to launch MATLAB R2026a due to Licensing Error 5005.
Steps I have already taken:
Attempted manual activation using activate_matlab.exe as Administrator.
Performed a clean reinstall, manually deleting the following folders:
C:Program FilesMATLABR2026a
C:UsersdanieAppDataRoamingMathWorks
I noticed a ghost entry for a previous version (R2022a) in Windows Settings that points to a non-existent path on the Desktop, which I cannot remove.
Checked the licenses folder; it was empty or contained a file that didn’t resolve the issue.
I have attached a screenshot of the error message. How can I force MATLAB to recognize my valid license? installation, licensing, error 5005, activation MATLAB Answers — New Questions
Vulnerability in Apache Log4j version included in 2025a relating to CVE-2026-34480 and CVE-2026-34477
Do either of these vulnerabilites affect Matlab 2025a, 2025b or 2026a as a result of the distribution of Log4j version included, e.g. for Matlab 2025a C:Program FilesMATLABR2025ajavajarextlog4j-core-2.17.1.jar.Do either of these vulnerabilites affect Matlab 2025a, 2025b or 2026a as a result of the distribution of Log4j version included, e.g. for Matlab 2025a C:Program FilesMATLABR2025ajavajarextlog4j-core-2.17.1.jar. Do either of these vulnerabilites affect Matlab 2025a, 2025b or 2026a as a result of the distribution of Log4j version included, e.g. for Matlab 2025a C:Program FilesMATLABR2025ajavajarextlog4j-core-2.17.1.jar. log4j, cve-2026-34480, cve-2026-34477 MATLAB Answers — New Questions
Error in simscape when computing derivative
I have a Simscape block that takes linPosition (physical signal) as an input and computes rotPosition (another physical signal). If I put it in my model, where linPosition is 0 for 1ms and then starts increasing smoothly, it works (rotPosition and theta are constant for 1ms and then follow the growth of linPosition). The problem arises when I try to add an additional computation: omega == der(theta) (I need it to make more calculation and provide another output). With that additional equation, I get this warning:
Equations (including nonlinear equations) of one or more components may be dependent or inconsistent. This can cause problems in transient initialization.
referred to the first and second equations. Then the simulation stops at 1ms:
An error occurred during simulation and the simulation was stopped
Caused by:
[‘testCircuit/Solver Configuration’]: Transient initialization at time 0.001, solving for consistent states and modes, failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
all components and nodal across variables involved
Cannot solve for one or more variables, including dynamic variable derivatives:
Time derivative of ‘CRIB.CRIB_velocityBased.breaking_part.offsetSliderCrank.theta’ (rot angle with respect to horizontal)
‘CRIB.CRIB_velocityBased.breaking_part.offsetSliderCrank.omega’ (omega)
In my mind, theta and gamma in the equations are computed and then omega follows the value of theta, but I guess that this is not how it works.
component offsetSliderCrank
inputs
linPosition = {0, ‘mm’};
end
outputs
rotPosition = {0, ‘deg’};
end
parameters
lRod = { 45, ‘mm’ }; %
rJunction = { 10, ‘mm’ }; %
xC = { 2, ‘mm’ }; %
yC = { 40, ‘mm’ }; %
end
variables(Access=Protected)
theta = {value={0,’deg’},imin={-90,’deg’},imax={89,’deg’}}; % rot angle with respect to horizontal
gamma = {value={0,’deg’},imin={0,’deg’},imax={180,’deg’}}; % angle between lRod and horizontal
omega = {0,’deg/s’};
end
equations
lRod*cos(gamma)+xC == rJunction*cos(theta);
yC-linPosition – rJunction*sin(theta) == lRod*sin(gamma);
let
theta0 = asin((yC^2+rJunction^2-lRod^2+xC^2)/(2*rJunction*sqrt(xC^2+yC^2))) – atan(xC/yC) ;
in
rotPosition == – (theta- theta0);
end
omega == der(theta);
end
endI have a Simscape block that takes linPosition (physical signal) as an input and computes rotPosition (another physical signal). If I put it in my model, where linPosition is 0 for 1ms and then starts increasing smoothly, it works (rotPosition and theta are constant for 1ms and then follow the growth of linPosition). The problem arises when I try to add an additional computation: omega == der(theta) (I need it to make more calculation and provide another output). With that additional equation, I get this warning:
Equations (including nonlinear equations) of one or more components may be dependent or inconsistent. This can cause problems in transient initialization.
referred to the first and second equations. Then the simulation stops at 1ms:
An error occurred during simulation and the simulation was stopped
Caused by:
[‘testCircuit/Solver Configuration’]: Transient initialization at time 0.001, solving for consistent states and modes, failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
all components and nodal across variables involved
Cannot solve for one or more variables, including dynamic variable derivatives:
Time derivative of ‘CRIB.CRIB_velocityBased.breaking_part.offsetSliderCrank.theta’ (rot angle with respect to horizontal)
‘CRIB.CRIB_velocityBased.breaking_part.offsetSliderCrank.omega’ (omega)
In my mind, theta and gamma in the equations are computed and then omega follows the value of theta, but I guess that this is not how it works.
component offsetSliderCrank
inputs
linPosition = {0, ‘mm’};
end
outputs
rotPosition = {0, ‘deg’};
end
parameters
lRod = { 45, ‘mm’ }; %
rJunction = { 10, ‘mm’ }; %
xC = { 2, ‘mm’ }; %
yC = { 40, ‘mm’ }; %
end
variables(Access=Protected)
theta = {value={0,’deg’},imin={-90,’deg’},imax={89,’deg’}}; % rot angle with respect to horizontal
gamma = {value={0,’deg’},imin={0,’deg’},imax={180,’deg’}}; % angle between lRod and horizontal
omega = {0,’deg/s’};
end
equations
lRod*cos(gamma)+xC == rJunction*cos(theta);
yC-linPosition – rJunction*sin(theta) == lRod*sin(gamma);
let
theta0 = asin((yC^2+rJunction^2-lRod^2+xC^2)/(2*rJunction*sqrt(xC^2+yC^2))) – atan(xC/yC) ;
in
rotPosition == – (theta- theta0);
end
omega == der(theta);
end
end I have a Simscape block that takes linPosition (physical signal) as an input and computes rotPosition (another physical signal). If I put it in my model, where linPosition is 0 for 1ms and then starts increasing smoothly, it works (rotPosition and theta are constant for 1ms and then follow the growth of linPosition). The problem arises when I try to add an additional computation: omega == der(theta) (I need it to make more calculation and provide another output). With that additional equation, I get this warning:
Equations (including nonlinear equations) of one or more components may be dependent or inconsistent. This can cause problems in transient initialization.
referred to the first and second equations. Then the simulation stops at 1ms:
An error occurred during simulation and the simulation was stopped
Caused by:
[‘testCircuit/Solver Configuration’]: Transient initialization at time 0.001, solving for consistent states and modes, failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
all components and nodal across variables involved
Cannot solve for one or more variables, including dynamic variable derivatives:
Time derivative of ‘CRIB.CRIB_velocityBased.breaking_part.offsetSliderCrank.theta’ (rot angle with respect to horizontal)
‘CRIB.CRIB_velocityBased.breaking_part.offsetSliderCrank.omega’ (omega)
In my mind, theta and gamma in the equations are computed and then omega follows the value of theta, but I guess that this is not how it works.
component offsetSliderCrank
inputs
linPosition = {0, ‘mm’};
end
outputs
rotPosition = {0, ‘deg’};
end
parameters
lRod = { 45, ‘mm’ }; %
rJunction = { 10, ‘mm’ }; %
xC = { 2, ‘mm’ }; %
yC = { 40, ‘mm’ }; %
end
variables(Access=Protected)
theta = {value={0,’deg’},imin={-90,’deg’},imax={89,’deg’}}; % rot angle with respect to horizontal
gamma = {value={0,’deg’},imin={0,’deg’},imax={180,’deg’}}; % angle between lRod and horizontal
omega = {0,’deg/s’};
end
equations
lRod*cos(gamma)+xC == rJunction*cos(theta);
yC-linPosition – rJunction*sin(theta) == lRod*sin(gamma);
let
theta0 = asin((yC^2+rJunction^2-lRod^2+xC^2)/(2*rJunction*sqrt(xC^2+yC^2))) – atan(xC/yC) ;
in
rotPosition == – (theta- theta0);
end
omega == der(theta);
end
end simscape, derivative MATLAB Answers — New Questions
Copilot cannot access matlab environment?
In most IDEs you can ask the LLM about the code on the screen, and the copilot chat seems to think it can access the editor, although I could not get it to actually do so. After trying to do this and getting a lot of conflicted answers I finally got this:
Me
Can you read files that are currently open in matlab?
Copilot
No — I cannot directly read files on your machine or access the MATLAB Editor. I can only work with text or files you share here.
Is that correct? The chat is not actually integrated with the Matlab like in a normal IDE (VS, VSCode, etc)? Is there some way to fix this or otherwise get it to work with the environment? Or if it is intentional it might be helpful to explain that the system is much more limited than it thinks it is.In most IDEs you can ask the LLM about the code on the screen, and the copilot chat seems to think it can access the editor, although I could not get it to actually do so. After trying to do this and getting a lot of conflicted answers I finally got this:
Me
Can you read files that are currently open in matlab?
Copilot
No — I cannot directly read files on your machine or access the MATLAB Editor. I can only work with text or files you share here.
Is that correct? The chat is not actually integrated with the Matlab like in a normal IDE (VS, VSCode, etc)? Is there some way to fix this or otherwise get it to work with the environment? Or if it is intentional it might be helpful to explain that the system is much more limited than it thinks it is. In most IDEs you can ask the LLM about the code on the screen, and the copilot chat seems to think it can access the editor, although I could not get it to actually do so. After trying to do this and getting a lot of conflicted answers I finally got this:
Me
Can you read files that are currently open in matlab?
Copilot
No — I cannot directly read files on your machine or access the MATLAB Editor. I can only work with text or files you share here.
Is that correct? The chat is not actually integrated with the Matlab like in a normal IDE (VS, VSCode, etc)? Is there some way to fix this or otherwise get it to work with the environment? Or if it is intentional it might be helpful to explain that the system is much more limited than it thinks it is. copilot MATLAB Answers — New Questions
Simscape Multibody: What is the difference between the force and the motion actuation in prismatic joint?
I have a simscape model, in which a set of spheres are trying to grab a cylinder. I used the spatial contact force block between the cylinder and spheres. I set up two ways that the spheres move up: 1, Input a motion actuation to the prismatic model; 2, Input a force actuation to the prismatic model.
For setup 1: The tube does NOT move. The spheres slip along the cylinder.
For setup 2: The tube MOVE UP with the spheres.
All the other settings are the same except the input actuation. So I am wondering what is the reason for this? Can anyone help to answer? Thanks!I have a simscape model, in which a set of spheres are trying to grab a cylinder. I used the spatial contact force block between the cylinder and spheres. I set up two ways that the spheres move up: 1, Input a motion actuation to the prismatic model; 2, Input a force actuation to the prismatic model.
For setup 1: The tube does NOT move. The spheres slip along the cylinder.
For setup 2: The tube MOVE UP with the spheres.
All the other settings are the same except the input actuation. So I am wondering what is the reason for this? Can anyone help to answer? Thanks! I have a simscape model, in which a set of spheres are trying to grab a cylinder. I used the spatial contact force block between the cylinder and spheres. I set up two ways that the spheres move up: 1, Input a motion actuation to the prismatic model; 2, Input a force actuation to the prismatic model.
For setup 1: The tube does NOT move. The spheres slip along the cylinder.
For setup 2: The tube MOVE UP with the spheres.
All the other settings are the same except the input actuation. So I am wondering what is the reason for this? Can anyone help to answer? Thanks! simscape, spatial contact force, prismatic joint MATLAB Answers — New Questions
How to calculate spray cone angle with videos?
Hello, everyone!
I have a high-speed video where a new spray image appears approximately every second, and I need to automate the extraction of the spray cone angle for each frame. Additionally, I would like to generate a plot to demonstrate the angle variations after every 200 analyses. I would greatly appreciate any suggestions, relevant functions, or example scripts regarding the best image processing workflow for boundary detection, as well as advice on how to structure the loop for sequential processing and periodic plot updates. Thank you very much for your time and patience!Hello, everyone!
I have a high-speed video where a new spray image appears approximately every second, and I need to automate the extraction of the spray cone angle for each frame. Additionally, I would like to generate a plot to demonstrate the angle variations after every 200 analyses. I would greatly appreciate any suggestions, relevant functions, or example scripts regarding the best image processing workflow for boundary detection, as well as advice on how to structure the loop for sequential processing and periodic plot updates. Thank you very much for your time and patience! Hello, everyone!
I have a high-speed video where a new spray image appears approximately every second, and I need to automate the extraction of the spray cone angle for each frame. Additionally, I would like to generate a plot to demonstrate the angle variations after every 200 analyses. I would greatly appreciate any suggestions, relevant functions, or example scripts regarding the best image processing workflow for boundary detection, as well as advice on how to structure the loop for sequential processing and periodic plot updates. Thank you very much for your time and patience! spray, angle, video, help MATLAB Answers — New Questions
Planner Synchronization of Microsoft 365 Message Center Notifications Improves
Synchronization Gives Planner Tasks HTML Formatted Task Descriptions
As any Microsoft 365 administrator can attest, Microsoft publishes a huge number of notifications in the message center. The exact number depends on the license subscriptions held by the tenant, but any tenant is likely to see between 450 and 700 notifications annually. Keeping track of so many changes is hard, which is why we recommend that tenants use the feature to synchronize message center posts to Planner. It is so much easier to manage tasks in Planner than it is to manage message center posts in the Microsoft 365 admin center.
The Office 365 for IT Pros team uses the synchronization capability to help us to track change within Microsoft 365. Planner has proven to be a valuable tool for us over the last seven years. Between the basic technology and the possibilities liberated by the Graph APIs (like creating a weekly open tasks report and emailing the report to each author), maintaining chapter files isn’t as hard as it could be.
Not Complex Synchronization
The synchronization technology used between the Microsoft 365 admin center and Planner isn’t very complex and can be replicated using PowerShell and the Microsoft Graph APIs. Part of the synchronization is to take the description of a change included in a message center notification and insert it into a task. In the past, the synchronization hasn’t done a great job here, taking the carefully formatted text published by Microsoft (Figure 1) and turning it into plain text (Figure 2).


The Change in MC1307883
Appropriately, the news of the change comes in message center notification MC1307883 (11 May 2026), which announces that the synchronization to Planner will preserve the HTML-formatted descriptions from May 13, 2026. As Microsoft notes, the change will make “it easier to review updates, understand impact, and follow links without losing context.” Figure 3 shows what the new HTML-formatted text looks like in a Planner task description.

I couldn’t agree more. Most of the time it is reasonably easy to interpret the task descriptions synchronized from the Microsoft 365 admin center to Planner, but the lack of some formatting like hyperlinks and the poor formatting like spaces and new line markers being inserted in arbitrary places can be off-putting.
Even better than simply making sure that new tasks synchronized to Planner are formatted correctly, Microsoft will go back and update previous tasks to replace plain text descriptions with the HTML content. This process will happen over time. You can’t expect perfection overnight.
Awash with New Development
Waiting for change in Planner is a bit like waiting for a bus: nothing happens for a long time and then lots happens rapidly. Microsoft recently launched a new Planner UI and tenants with Microsoft 365 Copilot licenses can use the Planner agent to get some advice about the actions required to accomplish tasks. Meantime, work to prepare for the retirement of Project Online on September 30, 2026 and the consolidation into Planner continues.
In Closing
As we head into the weekend, I wanted to highlight message center notification MC1304289 (8 May 2026). Like Planner, the Office 365 for IT Pros eBook team depends on Word. All our content is created in Word, and we use co-authoring at times to enable reviews by editors and technical editors.
Which is why we like the news that Word will support editing by multiple users simultaneously in the same paragraph. Microsoft says that “this enhancement reduces edit conflicts and interruptions, helping teams collaborate more efficiently.” We think it just makes life a little easier.
Learn how to use Planner and to exploit the data available to Microsoft 365 tenant administrators through the Office 365 for IT Pros eBook. We love figuring out how things work.
How to install Surrogate Toolbox 3.0 by Dr. Viana?
I am trying to Install <https://sites.google.com/site/srgtstoolbox/ Surrogate Toolbox 3.0>
by Dr. Viana in 64 bit machine with Windows 10. It seems to be very easy, but somehow I am getting the error while installing.
I am getting:
—————————————————————————
What would you like to do? 2
Building with ‘Microsoft Visual C++ 2013 Professional (C)’.
MEX completed successfully.
Error using fileparts
Too many output arguments.
Error in srgtsSVMGunnFiles>srgtsCompileSVMGunn (line 101)
[pathstr, name, ext, versn] = fileparts(file_source);
Error in srgtsSVMGunnFiles (line 61)
[file_source filename] = srgtsCompileSVMGunn(srgtsRootDir, interpreter);
Error in srgtsInstall (line 75)
srgtsSVMGunnFiles(srgtsRootDir, hostname, interpreter);I am trying to Install <https://sites.google.com/site/srgtstoolbox/ Surrogate Toolbox 3.0>
by Dr. Viana in 64 bit machine with Windows 10. It seems to be very easy, but somehow I am getting the error while installing.
I am getting:
—————————————————————————
What would you like to do? 2
Building with ‘Microsoft Visual C++ 2013 Professional (C)’.
MEX completed successfully.
Error using fileparts
Too many output arguments.
Error in srgtsSVMGunnFiles>srgtsCompileSVMGunn (line 101)
[pathstr, name, ext, versn] = fileparts(file_source);
Error in srgtsSVMGunnFiles (line 61)
[file_source filename] = srgtsCompileSVMGunn(srgtsRootDir, interpreter);
Error in srgtsInstall (line 75)
srgtsSVMGunnFiles(srgtsRootDir, hostname, interpreter); I am trying to Install <https://sites.google.com/site/srgtstoolbox/ Surrogate Toolbox 3.0>
by Dr. Viana in 64 bit machine with Windows 10. It seems to be very easy, but somehow I am getting the error while installing.
I am getting:
—————————————————————————
What would you like to do? 2
Building with ‘Microsoft Visual C++ 2013 Professional (C)’.
MEX completed successfully.
Error using fileparts
Too many output arguments.
Error in srgtsSVMGunnFiles>srgtsCompileSVMGunn (line 101)
[pathstr, name, ext, versn] = fileparts(file_source);
Error in srgtsSVMGunnFiles (line 61)
[file_source filename] = srgtsCompileSVMGunn(srgtsRootDir, interpreter);
Error in srgtsInstall (line 75)
srgtsSVMGunnFiles(srgtsRootDir, hostname, interpreter); surrogate toolbox MATLAB Answers — New Questions
Non-linear data fit with multiple constants
I have a non-linear equation with 3 variables I wish to be constants and only 1 variable to be fitted to x,y data.
Using fittype, I have entered the equation and tried to specify b, c & d as constants. However, the options ‘problem’ only seems to allow single variables to be specified as constants
ft = fittype(@(a, b, c, d,x) a*c*x./(1+c*x) + b*d*x./(1+d*x),’problem’,’b,c,d’);
Error using fittype>iAssertValidVariableNames
The name ‘[b,c,d]’ is not a valid MATLAB variable name.
In the next part I use "fit" to fit the data, and specify the value of the 3 constants and starting point of the fit:
f = fit(p(1:index),q(1:index),ft,’problem’,[Qm2 b1 b2],’StartPoint’,Qm1);
Is there another way to specify constants in the fittype?I have a non-linear equation with 3 variables I wish to be constants and only 1 variable to be fitted to x,y data.
Using fittype, I have entered the equation and tried to specify b, c & d as constants. However, the options ‘problem’ only seems to allow single variables to be specified as constants
ft = fittype(@(a, b, c, d,x) a*c*x./(1+c*x) + b*d*x./(1+d*x),’problem’,’b,c,d’);
Error using fittype>iAssertValidVariableNames
The name ‘[b,c,d]’ is not a valid MATLAB variable name.
In the next part I use "fit" to fit the data, and specify the value of the 3 constants and starting point of the fit:
f = fit(p(1:index),q(1:index),ft,’problem’,[Qm2 b1 b2],’StartPoint’,Qm1);
Is there another way to specify constants in the fittype? I have a non-linear equation with 3 variables I wish to be constants and only 1 variable to be fitted to x,y data.
Using fittype, I have entered the equation and tried to specify b, c & d as constants. However, the options ‘problem’ only seems to allow single variables to be specified as constants
ft = fittype(@(a, b, c, d,x) a*c*x./(1+c*x) + b*d*x./(1+d*x),’problem’,’b,c,d’);
Error using fittype>iAssertValidVariableNames
The name ‘[b,c,d]’ is not a valid MATLAB variable name.
In the next part I use "fit" to fit the data, and specify the value of the 3 constants and starting point of the fit:
f = fit(p(1:index),q(1:index),ft,’problem’,[Qm2 b1 b2],’StartPoint’,Qm1);
Is there another way to specify constants in the fittype? curve fitting MATLAB Answers — New Questions
Why Graph-added People Skills Don’t Show Up on the User Profile Card
The Odd Case of Invisible Skills
Last week, I wrote about how to use Microsoft Graph PowerShell SDK cmdlets to add details of awards and certificates for inclusion on the Microsoft 365 user profile card. In the article, I mentioned that skills were the first user profile resource added by Microsoft in 2025, and this created a question about why custom skills created with Graph SDK cmdlets don’t show up on the profile card. It’s a good question, so let’s dive in and understand why.
Populating Skills
Microsoft’s People Skills service (introduced in 2025) includes over 16,000 skills that can be attributed to user accounts and displayed on the user profile card. The service uses AI analysis of peoples’ roles and their activity within Microsoft 365 to assign skills to users, Users can then confirm the assigned skills using the Update your profile option on the user profile card. Confirmed skills have a check mark to indicate their status (Figure 1).

Over time, the service might attribute new skills to users. These skills are unconfirmed (no check mark) until explicitly affirmed by the user. People can also add their own skills to the set. These skills are always deemed to be confirmed because a user has added (claimed) the skills.
Adding Skills via the Graph
Organizations can introduce skills data via a People Connector. This scenario covers the situation where an organization has skills data in an external repository like a HR database. The people connector ingests bulk skills information into the Microsoft Graph. Alternatively, the Skills Graph API can be used to update skills information for individual user profiles. Of course, there’s nothing to stop an organization reading information from a source and using that information to update user profiles with the Graph APIs. Here’s an example of adding a skill to a user profile with the New-MgBetaUserProfileSkill cmdlet from the Microsoft Graph PowerShell SDK:
$SkillToAdd = "Microsoft 365 Copilot"
$Skill = @{}
$Skill.Add("allowedAudiences", "organization")
$Skill.Add("proficiency", "Expert")
$Skill.Add("displayName",$SkillToAdd)
New-MgBetaUserProfileSkill -UserId $User.Id -BodyParameter $Skill -ErrorAction Stop
But here’s where the complication arises. Skill data imported via a connector or added using the Graph API is ignored by the user profile card once a Microsoft 365 tenant enables People Skills. When People Skills is active, that service becomes the only source for skills information displayed on user profile cards. The Microsoft documentation says:
“If the tenant opts in to the People Skills service, only skills that originate from People Skills are displayed on the profile card. In this scenario, when People Skills is enabled, skills from people connectors are only available in people search and Microsoft 365 Copilot Chat.”
In other words, when People Skills is in use by a tenant, any other skills data is ignored. On the plus side, skills added via the Graph or connector are used by Microsoft 365 Copilot when asked to find people with a certain skill.
There doesn’t appear to be any technical reason why Microsoft has imposed a block except to defend the People Skills service for some commercial or internal reason. In any case, it’s a silly decision that blocks tenants from being able to take advantage of the People Skills service at the same time as having the option to add individual skills to user profiles via the Graph.
One More Thing
When I discussed adding resources to the user profile card via the Graph, I failed to note that the APIs (and cmdlets) do not check if a user profile already possesses a specific resource before allowing the same resource to be added. Take the example of the Microsoft 365 Copilot skill shown above. It’s possible to run the New-MgBetaUserProfileSkill cmdlet multiple times to add the same skill to the same user profile. Each time a skill is added, the Graph assigns the entry a unique identifier. A human quickly realizes that multiple skills of the same type exists because they see the same display name, but software focuses on the skill identifier, which is different for each entry.
The fix is simple. Check if a resource already exists before you add it again. It’s all just a matter of code.
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.
Memoize an anonymous function with externally scoped variables
I am trying to memoize a function that takes an anonymous handle with an externally-scoped parameter as input. The problem is that no two anonymous functions are ever the same. Therefore, every time the memoization handle mf is invoked, it executes in its entirety and freshly cache’s the results.
mf=memoize(@subfunc);
A=3;
for i=1:4
mf(@(z)A*z)
end
I know that the Lord punisheth those who use eval(), but I can see no other alternative but to pass the anonymous function in char/string form and use evalin. This works fine when there are no externally-scoped variables. Caching indeed only occurs on the first call:
for i=1:4
mf(‘@(z)3*z’)
end
However, when the anonymous function does contain an externally-scoped variable A, the workaround fails.
A=3;
mf(‘@(z)A*z’)
So two questions,
Why does the workaround fail to find externally scoped variables?
Is there a more robust workaround?
function out = subfunc(argFun)
disp ‘Caching’
if isa(argFun,’function_handle’) %argFun is char or string
fun=argFun;
else
fun=evalin(‘caller’,argFun);
end
out=fun(5);
endI am trying to memoize a function that takes an anonymous handle with an externally-scoped parameter as input. The problem is that no two anonymous functions are ever the same. Therefore, every time the memoization handle mf is invoked, it executes in its entirety and freshly cache’s the results.
mf=memoize(@subfunc);
A=3;
for i=1:4
mf(@(z)A*z)
end
I know that the Lord punisheth those who use eval(), but I can see no other alternative but to pass the anonymous function in char/string form and use evalin. This works fine when there are no externally-scoped variables. Caching indeed only occurs on the first call:
for i=1:4
mf(‘@(z)3*z’)
end
However, when the anonymous function does contain an externally-scoped variable A, the workaround fails.
A=3;
mf(‘@(z)A*z’)
So two questions,
Why does the workaround fail to find externally scoped variables?
Is there a more robust workaround?
function out = subfunc(argFun)
disp ‘Caching’
if isa(argFun,’function_handle’) %argFun is char or string
fun=argFun;
else
fun=evalin(‘caller’,argFun);
end
out=fun(5);
end I am trying to memoize a function that takes an anonymous handle with an externally-scoped parameter as input. The problem is that no two anonymous functions are ever the same. Therefore, every time the memoization handle mf is invoked, it executes in its entirety and freshly cache’s the results.
mf=memoize(@subfunc);
A=3;
for i=1:4
mf(@(z)A*z)
end
I know that the Lord punisheth those who use eval(), but I can see no other alternative but to pass the anonymous function in char/string form and use evalin. This works fine when there are no externally-scoped variables. Caching indeed only occurs on the first call:
for i=1:4
mf(‘@(z)3*z’)
end
However, when the anonymous function does contain an externally-scoped variable A, the workaround fails.
A=3;
mf(‘@(z)A*z’)
So two questions,
Why does the workaround fail to find externally scoped variables?
Is there a more robust workaround?
function out = subfunc(argFun)
disp ‘Caching’
if isa(argFun,’function_handle’) %argFun is char or string
fun=argFun;
else
fun=evalin(‘caller’,argFun);
end
out=fun(5);
end memoize, eval, anonymous functions MATLAB Answers — New Questions
Is “ZCU208” board supported for the “Streaming Data from Hardware to Software” MATLAB example?
I wanted to confirm whether the Streaming Data from Hardware to Software MATLAB example supports the "AMD XILINX Zynq UltraScale+ RFSoC ZCU208" Evaluation Kit. I noticed that the lower specification "ZCU111" is supported; does this example also work with the "ZCU208"?I wanted to confirm whether the Streaming Data from Hardware to Software MATLAB example supports the "AMD XILINX Zynq UltraScale+ RFSoC ZCU208" Evaluation Kit. I noticed that the lower specification "ZCU111" is supported; does this example also work with the "ZCU208"? I wanted to confirm whether the Streaming Data from Hardware to Software MATLAB example supports the "AMD XILINX Zynq UltraScale+ RFSoC ZCU208" Evaluation Kit. I noticed that the lower specification "ZCU111" is supported; does this example also work with the "ZCU208"? amd, xilinx, xilinxzynq, zcu208 MATLAB Answers — New Questions









