Month: March 2026
How to Report Entra ID Group Insights
Preview of Entra ID Group Insights Don’t Deliver Anything Particularly Insightful
Entra ID Group Insights are a new preview feature that turned up in the Entra admin center in early February 2026 without benefit of a formal announcement or documentation. Divided into owner, member, lifecycle, and security and compliance, the insights (Figure 1) appear to be an attempt to bring easily addressable issues to the attention of tenant administrators.

Depending on the tenant configuration, some tenants will not apply. For example, if a tenant doesn’t use container management sensitivity labels to manage Microsoft 365 groups, the insight about the number of groups without labels is useless. Tenants without Entra P1 licenses can’t use dynamic Microsoft 365 groups or dynamic security groups, so the insights covering this topic won’t apply, and so on.
The insights are all very worthy, but there’s no magic here. Everything reported can be easily found with a few lines of PowerShell. Of course, the value is that administrators don’t have to master PowerShell to find the information, but the point is still valid that the current set of insights deliver no massive breakthrough in understanding about the overall health of groups within a tenant.
Identifiers Get in the Way of Understanding
In fact, the value of the insights is somewhat diminished by the output of group identifiers (GUIDs – Figure 2) instead of group names. I don’t know of many tenant administrators who speak fluent GUID. Computers do, but humans prefer names. I’m sure Microsoft will fix this issue before Entra ID Group Insights reach general availability.

Fetching Group Insights
Obviously, Microsoft doesn’t run PowerShell against every Entra tenant to create the data that underlines the insights revealed in the admin center. However, background processes do populate a data source for the insights, much like the Graph reports API generates data to report the usage of Microsoft 365 workloads. The preview seems to compute insights daily.
Like the Graph reports API, you can fetch the Entra ID Groups Insights with a GET call to the identityAnalytics Graph endpoint (the exact URI is easily found by observing browser traffic). The data is returned in an array, with an entry for each group found in the tenant. The calculatedDateTime property notes when the background process generated the insight data. The information for groups created, restored, or soft-deleted after a processing run won’t be accurate, but this shouldn’t affect the overall value of the insights.
$Uri = "https://graph.microsoft.com/beta/reports/identityAnalytics/groups" [array]$Data = Invoke-MgGraphRequest -Uri $Uri -Method Get -OutputType PsObject | Select-Object -ExpandProperty Value $Data[0] tenantId : a662313f-14fc-43a2-9a7a-d2e27f4f3478 id : 6ce28036-7129-4742-b59b-a73c310cbb6c calculatedDateTime : 28/03/2026 00:00:00 softDeletionDateTime : 01/01/0001 00:00:00 createdDateTime : 11/03/2019 11:20:10 dynamicMembershipType : groupExpirationDateTime : 01/01/0001 00:00:00 membershipRuleProcessingState : preferredDataLocation : lastRestorationDateTime : 01/01/0001 00:00:00 membershipRuleExpressionCount : 0 membershipRuleContainsCount : 0 membershipRuleMatchCount : 0 membershipRuleMemberOfCount : 0 assignedRoleCount : 0 sensitivityLabelCount : 1 guestOwnerCount : 0 memberOwnerCount : 1 servicePrincipalOwnerCount : 0 guestTransitiveUserCount : 0 memberTransitiveUserCount : 4 transitiveUserCount : 4 transitiveServicePrincipalCount : 0 directGroupMemberCount : 0 isValidGroup : True groupType : isCloudGroup isCloudM365Group : True isCloudDistributionListGroup : False isDynamicGroup : False isCloudSecurityGroup : False isOnPremiseSecurityGroup : False isOnPremiseMailEnabledSecurityGroup : False isCloudMailEnabledSecurityGroup : False isOnPremiseDistributionListGroup : False
Generating Tenant-Specific Group Insights
Being able to fetch the data makes it possible to interpret how the Entra ID admin center derives and presents the insights for a tenant. It also makes it possible to create a custom version of the Group Insights and add value like resolving the group identifier to find group names, finding who owns the groups, noting the group with most guest members, and so on.
As an example, I wrote a script to fetch information about the groups in a tenant and combine that data with the groups insights to generate a more complete view. It’s the same technique that’s used to supplement workload usage data with account information. Figure 3 shows the summary information generated at the end of the HTML version of the report (the script also creates an XLS or CSV file).

You can download the script to report Entra ID Group Insights from the Office 365 for IT Pros repository. The code is straightforward PowerShell, so feel free to change it to meet your tenant’s needs.
Improved Insights Must be Coming
I’m sure that Microsoft will improve the quality and quantity of the Entra ID Group Insights before the feature becomes generally available. Treat the preview as a sign of how Microsoft wants to deliver useful information to tenant administrators and be patient. Or build your own insights, which isn’t all that difficult to do.
Support the work of the Office 365 for IT Pros team by subscribing to the Office 365 for IT Pros eBook. Your support pays for the time we need to track, analyze, and document the changing world of Microsoft 365 and Office 365. Only humans contribute to our work!
Need to download MATLAB 2008b onto my existing computer but no more activations exist for my license
My company (MITRE) has implemented CyberArk security that prevents me from accessing MATLAB on my C: drive. I needed to transfer MATLAB over to my personal folder but inorder to do this, I had to uninstall MATLAB. Unfortunately, when I try to reinstall MATLAB 2008b, it says I have no further activations on the license. This is the same computer that I have been using — I have not changed computers. I needed a similar license refresh a couple of years ago when a security breach resulted in scrubing the disk, prompting me to reinstall all of my former software including MATLAB. Please advise — I really rely on this software for my work.
Thank youMy company (MITRE) has implemented CyberArk security that prevents me from accessing MATLAB on my C: drive. I needed to transfer MATLAB over to my personal folder but inorder to do this, I had to uninstall MATLAB. Unfortunately, when I try to reinstall MATLAB 2008b, it says I have no further activations on the license. This is the same computer that I have been using — I have not changed computers. I needed a similar license refresh a couple of years ago when a security breach resulted in scrubing the disk, prompting me to reinstall all of my former software including MATLAB. Please advise — I really rely on this software for my work.
Thank you My company (MITRE) has implemented CyberArk security that prevents me from accessing MATLAB on my C: drive. I needed to transfer MATLAB over to my personal folder but inorder to do this, I had to uninstall MATLAB. Unfortunately, when I try to reinstall MATLAB 2008b, it says I have no further activations on the license. This is the same computer that I have been using — I have not changed computers. I needed a similar license refresh a couple of years ago when a security breach resulted in scrubing the disk, prompting me to reinstall all of my former software including MATLAB. Please advise — I really rely on this software for my work.
Thank you license activation MATLAB Answers — New Questions
How do I compute bandpower?
Which parts of this code is correct? I’m getting confused on which sections are relevant for my question above?
N = length(sig1);
xdft1 = fft(sig1);
xdft1 = xdft1(1:N/2+1);
psdx1 = (1/(Fs*N)) * abs(xdft1).^2;
psdx1(2:end-1) = 2*psdx1(2:end-1);
freq1 = 0:Fs/length(sig1):Fs/2;
P1_band = psdx1(freq1 >= 20 & freq1 <= 100);
f1_band = freq1(freq1 >= 20 & freq1 <= 100);
power_sig1 = trapz(f1_band, P1_band);
noise = x_new – x_notch;
SNR_dB = snr(x_notch, noise);
P_signal = mean(signalSeg.^2, ‘omitnan’);
P_noise = mean(noiseSeg.^2, ‘omitnan’);
SNR_dB = 10*log10(P_signal / P_noise);
f_notch = 60;
BW_notch = 2;
wo = f_notch/(Fs/2);
Q = f_notch/BW_notch;
bw = wo/Q;
[b_n,a_n] = iirnotch(wo,bw);
x_notch = filtfilt(b_n,a_n,x_bp);
x = x(:);
t = (0:length(x)-1)’/Fs;
% Frequency analysis
x_dm = x – mean(x);
N = length(x_dm);
X = fft(x_dm);
K = floor(N/2);
X = X(1:K+1);
PSD = (1/(Fs*N)) * abs(X).^2;
if K > 1
PSD(2:end-1) = 2*PSD(2:end-1);
end
f = (0:K)’ * (Fs/N);
% Find dominant frequency
[~, idxPeak] = max(PSD(2:end)); % ignore 0 Hz
idxPeak = idxPeak + 1;
domFreq = f(idxPeak);
fprintf(‘Dominant frequency = %.2f Hzn’, domFreq);Which parts of this code is correct? I’m getting confused on which sections are relevant for my question above?
N = length(sig1);
xdft1 = fft(sig1);
xdft1 = xdft1(1:N/2+1);
psdx1 = (1/(Fs*N)) * abs(xdft1).^2;
psdx1(2:end-1) = 2*psdx1(2:end-1);
freq1 = 0:Fs/length(sig1):Fs/2;
P1_band = psdx1(freq1 >= 20 & freq1 <= 100);
f1_band = freq1(freq1 >= 20 & freq1 <= 100);
power_sig1 = trapz(f1_band, P1_band);
noise = x_new – x_notch;
SNR_dB = snr(x_notch, noise);
P_signal = mean(signalSeg.^2, ‘omitnan’);
P_noise = mean(noiseSeg.^2, ‘omitnan’);
SNR_dB = 10*log10(P_signal / P_noise);
f_notch = 60;
BW_notch = 2;
wo = f_notch/(Fs/2);
Q = f_notch/BW_notch;
bw = wo/Q;
[b_n,a_n] = iirnotch(wo,bw);
x_notch = filtfilt(b_n,a_n,x_bp);
x = x(:);
t = (0:length(x)-1)’/Fs;
% Frequency analysis
x_dm = x – mean(x);
N = length(x_dm);
X = fft(x_dm);
K = floor(N/2);
X = X(1:K+1);
PSD = (1/(Fs*N)) * abs(X).^2;
if K > 1
PSD(2:end-1) = 2*PSD(2:end-1);
end
f = (0:K)’ * (Fs/N);
% Find dominant frequency
[~, idxPeak] = max(PSD(2:end)); % ignore 0 Hz
idxPeak = idxPeak + 1;
domFreq = f(idxPeak);
fprintf(‘Dominant frequency = %.2f Hzn’, domFreq); Which parts of this code is correct? I’m getting confused on which sections are relevant for my question above?
N = length(sig1);
xdft1 = fft(sig1);
xdft1 = xdft1(1:N/2+1);
psdx1 = (1/(Fs*N)) * abs(xdft1).^2;
psdx1(2:end-1) = 2*psdx1(2:end-1);
freq1 = 0:Fs/length(sig1):Fs/2;
P1_band = psdx1(freq1 >= 20 & freq1 <= 100);
f1_band = freq1(freq1 >= 20 & freq1 <= 100);
power_sig1 = trapz(f1_band, P1_band);
noise = x_new – x_notch;
SNR_dB = snr(x_notch, noise);
P_signal = mean(signalSeg.^2, ‘omitnan’);
P_noise = mean(noiseSeg.^2, ‘omitnan’);
SNR_dB = 10*log10(P_signal / P_noise);
f_notch = 60;
BW_notch = 2;
wo = f_notch/(Fs/2);
Q = f_notch/BW_notch;
bw = wo/Q;
[b_n,a_n] = iirnotch(wo,bw);
x_notch = filtfilt(b_n,a_n,x_bp);
x = x(:);
t = (0:length(x)-1)’/Fs;
% Frequency analysis
x_dm = x – mean(x);
N = length(x_dm);
X = fft(x_dm);
K = floor(N/2);
X = X(1:K+1);
PSD = (1/(Fs*N)) * abs(X).^2;
if K > 1
PSD(2:end-1) = 2*PSD(2:end-1);
end
f = (0:K)’ * (Fs/N);
% Find dominant frequency
[~, idxPeak] = max(PSD(2:end)); % ignore 0 Hz
idxPeak = idxPeak + 1;
domFreq = f(idxPeak);
fprintf(‘Dominant frequency = %.2f Hzn’, domFreq); bandpower MATLAB Answers — New Questions
Why am I receiving errors when reading and writing to an instrument with Instrument Control Toolbox R2024b?
I am connecting to my Windows 11 based Keysight oscilloscope and source via "visadev." I intermittently receive the following two errors when reading and writing to the instruments using "fscanf" and "fprintf":
Error using matlabshared.transportlib.internal.compatibility.LegacyASCIIMixin/fprintf (line 140)
Error writing String.
Error writing data to the transport.
Adaptor command ‘write’ failed with status code: -550.
Error using matlabshared.transportlib.internal.compatibility.LegacyASCIIMixin/fscanf (line 305)
Failed to read data from the instrument due to a driver error.
These errors occur seemingly at random, and a similar error occurs when using the function "visa" instead of "visadev":
Error using icinterface/fprintf (line 158)
VISA: The IO connection for the session has been lost
Why do these errors occur and how can I prevent them?I am connecting to my Windows 11 based Keysight oscilloscope and source via "visadev." I intermittently receive the following two errors when reading and writing to the instruments using "fscanf" and "fprintf":
Error using matlabshared.transportlib.internal.compatibility.LegacyASCIIMixin/fprintf (line 140)
Error writing String.
Error writing data to the transport.
Adaptor command ‘write’ failed with status code: -550.
Error using matlabshared.transportlib.internal.compatibility.LegacyASCIIMixin/fscanf (line 305)
Failed to read data from the instrument due to a driver error.
These errors occur seemingly at random, and a similar error occurs when using the function "visa" instead of "visadev":
Error using icinterface/fprintf (line 158)
VISA: The IO connection for the session has been lost
Why do these errors occur and how can I prevent them? I am connecting to my Windows 11 based Keysight oscilloscope and source via "visadev." I intermittently receive the following two errors when reading and writing to the instruments using "fscanf" and "fprintf":
Error using matlabshared.transportlib.internal.compatibility.LegacyASCIIMixin/fprintf (line 140)
Error writing String.
Error writing data to the transport.
Adaptor command ‘write’ failed with status code: -550.
Error using matlabshared.transportlib.internal.compatibility.LegacyASCIIMixin/fscanf (line 305)
Failed to read data from the instrument due to a driver error.
These errors occur seemingly at random, and a similar error occurs when using the function "visa" instead of "visadev":
Error using icinterface/fprintf (line 158)
VISA: The IO connection for the session has been lost
Why do these errors occur and how can I prevent them? fprintf, fscanf, instrumentcontroltoolbox, write, read MATLAB Answers — New Questions
Title is missing when saving a figure using print, saveas, exportgraphics, and printpreview
Context: When plotting images, I have often set the tick marks to face outward, where they are not obscured by the image. This change requires that I nudge the title upward by a small amount so that it is separated from the ticks.
Problem: When I save the file using print, saveas, exportgraphics or printpreview, the title is sometimes missing in the output file. (See attached examples above.)
I found that this problem occurs when the image is plotted using pcolor (and probably surf as well). It does not occur when using plot and imagesc. Annotation is used below to draw an outline of the outer extent of the figure. The nudged title clearly lies within that limit.
Work Around: The problem is fixed by ensuring that the Units property for the title is set to data after adjusting the title position. Note that I have filed a bug report with Matlab.
Versions: This problem did not occur with Matlab versions 2022a and earlier. It started with version 2022b and continues with version 2023a.
Coded example:
function test_figureTitleProblem
%… Simple demonstration of missing title problem.
% When plotting images, I have often set the tick marks to face outward,
% where they are not obscurved by the image. This change requires that
% I nudge the title upward by a small amount so that it is separated
% from the ticks.
%
% Problem: When I save the file using print, saveas, exportgraphics
% and printpreview, the title is missing in the output file.
% I found that this problem occurs when the image is plotted using
% pcolor, and does not occur when imagesc is used. I also found
% that the problem can be fixed by changing the Units property for the title
% back to data (see below). Annotation is used below to draw an outline of
% the outer extent of the figure. The nudged title clearly lies within
% that limit.
%% Initialize variables
%… Load Matlab’s global topographic data
load(‘topo.mat’, ‘topo’);
%… Create grid vectors
lon = 0:359;
lat = -89:90;
%% Plot
figure
%… Missing title occurs with pcolor, and not with imagesc
pcolor(lon, lat, topo)
shading interp
% imagesc(lon, lat, topo)
% axis xy
%… Format plot
hA = gca;
hA.Box = ‘on’;
hA.TickDir = ‘out’; % Oriented tick marks to face outward
hA.Layer = ‘top’; % Places grid lines and tick markers on top of image
hA.FontSize = 16;
hA.LineWidth = 1;
%… Render title, and nudge upward to separate from outward tick marks
hT = title(‘Demonstration of Demonstration of Missing Title’, ‘FontSize’, 16);
hT.Units = ‘normalized’;
hT.Position(2) = hT.Position(2) + 0.02;
% hT.Units = ‘data’; % Uncomment this line to fix problem
%… Draw rectangle to show outer limit for figure
annotation("rectangle", hA.OuterPosition, Color="red", LineWidth=1)
%… Start print preview to show that the title is missing
print(‘missingTitle_print.pdf’, ‘-dpdf’)
saveas(hA, ‘missingTitle_saveas.pdf’)
exportgraphics(hA, ‘missingTitle_exportgraphics.pdf’)
printpreview
endContext: When plotting images, I have often set the tick marks to face outward, where they are not obscured by the image. This change requires that I nudge the title upward by a small amount so that it is separated from the ticks.
Problem: When I save the file using print, saveas, exportgraphics or printpreview, the title is sometimes missing in the output file. (See attached examples above.)
I found that this problem occurs when the image is plotted using pcolor (and probably surf as well). It does not occur when using plot and imagesc. Annotation is used below to draw an outline of the outer extent of the figure. The nudged title clearly lies within that limit.
Work Around: The problem is fixed by ensuring that the Units property for the title is set to data after adjusting the title position. Note that I have filed a bug report with Matlab.
Versions: This problem did not occur with Matlab versions 2022a and earlier. It started with version 2022b and continues with version 2023a.
Coded example:
function test_figureTitleProblem
%… Simple demonstration of missing title problem.
% When plotting images, I have often set the tick marks to face outward,
% where they are not obscurved by the image. This change requires that
% I nudge the title upward by a small amount so that it is separated
% from the ticks.
%
% Problem: When I save the file using print, saveas, exportgraphics
% and printpreview, the title is missing in the output file.
% I found that this problem occurs when the image is plotted using
% pcolor, and does not occur when imagesc is used. I also found
% that the problem can be fixed by changing the Units property for the title
% back to data (see below). Annotation is used below to draw an outline of
% the outer extent of the figure. The nudged title clearly lies within
% that limit.
%% Initialize variables
%… Load Matlab’s global topographic data
load(‘topo.mat’, ‘topo’);
%… Create grid vectors
lon = 0:359;
lat = -89:90;
%% Plot
figure
%… Missing title occurs with pcolor, and not with imagesc
pcolor(lon, lat, topo)
shading interp
% imagesc(lon, lat, topo)
% axis xy
%… Format plot
hA = gca;
hA.Box = ‘on’;
hA.TickDir = ‘out’; % Oriented tick marks to face outward
hA.Layer = ‘top’; % Places grid lines and tick markers on top of image
hA.FontSize = 16;
hA.LineWidth = 1;
%… Render title, and nudge upward to separate from outward tick marks
hT = title(‘Demonstration of Demonstration of Missing Title’, ‘FontSize’, 16);
hT.Units = ‘normalized’;
hT.Position(2) = hT.Position(2) + 0.02;
% hT.Units = ‘data’; % Uncomment this line to fix problem
%… Draw rectangle to show outer limit for figure
annotation("rectangle", hA.OuterPosition, Color="red", LineWidth=1)
%… Start print preview to show that the title is missing
print(‘missingTitle_print.pdf’, ‘-dpdf’)
saveas(hA, ‘missingTitle_saveas.pdf’)
exportgraphics(hA, ‘missingTitle_exportgraphics.pdf’)
printpreview
end Context: When plotting images, I have often set the tick marks to face outward, where they are not obscured by the image. This change requires that I nudge the title upward by a small amount so that it is separated from the ticks.
Problem: When I save the file using print, saveas, exportgraphics or printpreview, the title is sometimes missing in the output file. (See attached examples above.)
I found that this problem occurs when the image is plotted using pcolor (and probably surf as well). It does not occur when using plot and imagesc. Annotation is used below to draw an outline of the outer extent of the figure. The nudged title clearly lies within that limit.
Work Around: The problem is fixed by ensuring that the Units property for the title is set to data after adjusting the title position. Note that I have filed a bug report with Matlab.
Versions: This problem did not occur with Matlab versions 2022a and earlier. It started with version 2022b and continues with version 2023a.
Coded example:
function test_figureTitleProblem
%… Simple demonstration of missing title problem.
% When plotting images, I have often set the tick marks to face outward,
% where they are not obscurved by the image. This change requires that
% I nudge the title upward by a small amount so that it is separated
% from the ticks.
%
% Problem: When I save the file using print, saveas, exportgraphics
% and printpreview, the title is missing in the output file.
% I found that this problem occurs when the image is plotted using
% pcolor, and does not occur when imagesc is used. I also found
% that the problem can be fixed by changing the Units property for the title
% back to data (see below). Annotation is used below to draw an outline of
% the outer extent of the figure. The nudged title clearly lies within
% that limit.
%% Initialize variables
%… Load Matlab’s global topographic data
load(‘topo.mat’, ‘topo’);
%… Create grid vectors
lon = 0:359;
lat = -89:90;
%% Plot
figure
%… Missing title occurs with pcolor, and not with imagesc
pcolor(lon, lat, topo)
shading interp
% imagesc(lon, lat, topo)
% axis xy
%… Format plot
hA = gca;
hA.Box = ‘on’;
hA.TickDir = ‘out’; % Oriented tick marks to face outward
hA.Layer = ‘top’; % Places grid lines and tick markers on top of image
hA.FontSize = 16;
hA.LineWidth = 1;
%… Render title, and nudge upward to separate from outward tick marks
hT = title(‘Demonstration of Demonstration of Missing Title’, ‘FontSize’, 16);
hT.Units = ‘normalized’;
hT.Position(2) = hT.Position(2) + 0.02;
% hT.Units = ‘data’; % Uncomment this line to fix problem
%… Draw rectangle to show outer limit for figure
annotation("rectangle", hA.OuterPosition, Color="red", LineWidth=1)
%… Start print preview to show that the title is missing
print(‘missingTitle_print.pdf’, ‘-dpdf’)
saveas(hA, ‘missingTitle_saveas.pdf’)
exportgraphics(hA, ‘missingTitle_exportgraphics.pdf’)
printpreview
end missing title MATLAB Answers — New Questions
How to use the nonlinear least square fitting to fit a transfer function?How to improve the fitting accuracy
I have a dataset Y representing the real part Y(:,1) and the imaginary part (Y:,2) of a function against the frequency fq. I want to find the coefficient of the transfer function to have the a good fit with the dataset. The transfer function is given assumed to have a fifth order, (so there are totally 10 unknowns) T(p,q,s)=p(5)*s^4+p(4)*s^3+p(3)*s^2+p(2)*s+p(1))/(s^5+q(5)*s^4+q(4)*s^3+q(3)*s^2+q(2)*s+q(1));
The code is given in the attached, I split the objective function as the imaginary and real part respectively, the objective function is (real(T)-Y(:,1))^2+(imag(T)-Y(:,2)) over all the selected points in the Y-fq curve.
The blue circle is the fitted result from the NLSQ, but they are slightly away from the original data. My question is how to improve the code to improve the fitting result.
In the attached files,"nonlsqfitting.mat" is the Y and fq data; NLSFmat is the runing code; OBJrealimag.m is the objective function, where Yout(:,1) is the real part of T and Yout(:,2) is the imaginary part of T.I have a dataset Y representing the real part Y(:,1) and the imaginary part (Y:,2) of a function against the frequency fq. I want to find the coefficient of the transfer function to have the a good fit with the dataset. The transfer function is given assumed to have a fifth order, (so there are totally 10 unknowns) T(p,q,s)=p(5)*s^4+p(4)*s^3+p(3)*s^2+p(2)*s+p(1))/(s^5+q(5)*s^4+q(4)*s^3+q(3)*s^2+q(2)*s+q(1));
The code is given in the attached, I split the objective function as the imaginary and real part respectively, the objective function is (real(T)-Y(:,1))^2+(imag(T)-Y(:,2)) over all the selected points in the Y-fq curve.
The blue circle is the fitted result from the NLSQ, but they are slightly away from the original data. My question is how to improve the code to improve the fitting result.
In the attached files,"nonlsqfitting.mat" is the Y and fq data; NLSFmat is the runing code; OBJrealimag.m is the objective function, where Yout(:,1) is the real part of T and Yout(:,2) is the imaginary part of T. I have a dataset Y representing the real part Y(:,1) and the imaginary part (Y:,2) of a function against the frequency fq. I want to find the coefficient of the transfer function to have the a good fit with the dataset. The transfer function is given assumed to have a fifth order, (so there are totally 10 unknowns) T(p,q,s)=p(5)*s^4+p(4)*s^3+p(3)*s^2+p(2)*s+p(1))/(s^5+q(5)*s^4+q(4)*s^3+q(3)*s^2+q(2)*s+q(1));
The code is given in the attached, I split the objective function as the imaginary and real part respectively, the objective function is (real(T)-Y(:,1))^2+(imag(T)-Y(:,2)) over all the selected points in the Y-fq curve.
The blue circle is the fitted result from the NLSQ, but they are slightly away from the original data. My question is how to improve the code to improve the fitting result.
In the attached files,"nonlsqfitting.mat" is the Y and fq data; NLSFmat is the runing code; OBJrealimag.m is the objective function, where Yout(:,1) is the real part of T and Yout(:,2) is the imaginary part of T. nonlinear least square fitting transfer function MATLAB Answers — New Questions
Conditional Access Policies are the Best Way to Block Weekend Access to Microsoft 365
Use a Scheduled Runbook to Enable and Disable Conditional Access Policies
Recently, MVP Daniel Bradley wrote about a beta feature for conditional access policies that allows time-limited application of blocks. The idea appears to be that you can configure days and times as conditions for a policy to permit connections to a tenant during those periods. At least, that’s what I think Microsoft intends to do. The total lack of documentation means that some detective work is needed to make things work.
It’s curious that Microsoft has a feature that’s accessible through the beta Graph endpoint that isn’t documented. Perhaps the developers are backing away from the feature because of lack of customer demand. At one point, businesses were concerned about people working out of hours, and a French law from 2016 gave employees the right to avoid using IT systems over the weekend and at holiday periods. The law still appears to be on the books, but I haven’t heard much about its use.
Of course, 2017 was before Covid-19 and the move to remote working and flexibility. Even though many organizations have rowed back on permitting employees to work outside the office, the world of work is subject to different influences than it was ten years ago. At this point, organizations probably like employees to work around the clock.
Exploring Methods to Block Access
But if a company wants to restrict connections to Microsoft 365 at certain times, what’s the best way to achieve the goal?
I think conditional access policies are the best response, but you don’t need a partially-implemented beta feature to do the job. Instead, a simple conditional access policy that blocks all access to all resources for everyone except a set of excluded accounts (like administrators and break glass accounts) is all that’s necessary. The trick is to switch the conditional access policy on and off accurately. For example, you might want to disable connections at 8 pm on Friday evenings and allow access again at 7 am on Monday morning.
The best approach to enabling and disabling conditional access policies is to use scheduled Azure Automation runbooks configured to execute at the times when you want to enable and disable connectivity. All a runbook must do is update the target conditional access policy to turn it off or on as appropriate. If deemed desirable, you could revoke user access tokens for the user accounts in the target group at the same time. The runbook code (using the Microsoft Graph PowerShell SDK) might look like this:
# Code for Azure Automation runbook to enable a conditional access policy to block weekend access for a specific group, and revoke sessions for all members of that group
# Requires Policy.ReadWrite.ConditionalAccess, Group.Read.All, User.RevokeSessions.All, and GroupMember.Read.All permissions
Connect-MgGraph -Identity
# Get membership of dynamic group containing user accounts to block (same group
# is used by the CA policy)
[array]$Users = Get-MgGroupMember -GroupId (Get-MgGroup -Filter "displayName eq 'CA Block Weekend Access (France)'").Id
# Revoke access for each member
ForEach ($User in $Users) {
Try {
$Status = Revoke-MgUserSignInSession -UserId $User.Id -ErrorAction Stop
Write-Output ("Revoked access for {0}" -f $User.additionalProperties.displayName)
} Catch {
If ($_.Exception.Message -match "temporarily") {
Write-Warning ("Temporarily unable to revoke access for {0}, will retry after 15 seconds" -f $User.additionalProperties.DisplayName)
Start-Sleep -Seconds 5
Revoke-MgUserSignSession -UserId $User.Id
Write-Output ("Revoked access for {0}" -f $User.additionalProperties.displayName)
} Else {
Write-Error ("Failed to revoke access for {0}: {1}" -f $User.additionalProperties.displayName, $_.Exception.Message)
}
}
}
# Now enable the conditional access policy to block access for this group over the weekend
$Policy = Get-MgIdentityConditionalAccessPolicy -Filter "displayName eq 'Block Weekend Access'"
If ($Policy) {
Try {
Update-MgIdentityConditionalAccessPolicy -ConditionalAccessPolicyId $Policy.Id -State Enabled -ErrorAction Stop
Write-Output "Conditional Access policy 'Block Weekend Access' is now enabled"
} Catch {
Write-Error ("Failed to enable 'Block Weekend Access' policy: {0}" -f $_.Exception.Message)
}
}
Access tokens will expire within an hour, and the users won’t be able to reconnect because the conditional access policy will block their connections until reconnections are allowed again.
Handling International Employees
In an international company, you might need a set of conditional access policies to handle connectivity for different user populations. For example, German employees work in the UTC -1 time zone while U.S.-based employees work across several time zones. These conditions can be handled by having conditional access policies apply to different groups. Dynamic groups with membership rules based on country or office location are the best way to manage the users for each country.
Simpler Approaches Are Available
If your tenant doesn’t have the Entra P1 licenses required for conditional access policies and dynamic groups, you can disable accounts at the weekend by running a scheduled PowerShell script in Azure Automation (or use Windows Task Scheduler, if you must).

Disabling accounts is a cheap and cheerful method to block access, but it does mean that people might suspect that their job is in danger when they realize that their accounts are disabled. That wouldn’t be a good thing, and that’s why using a conditional access policy (with a more subtle message – Figure 1) to block access at certain times is a better approach. The bottom line is that no one can stop people working offline at the weekend, but conditional access policies (with a little help) can block access to online services.
Support the work of the Office 365 for IT Pros team by subscribing to the Office 365 for IT Pros eBook. Your support pays for the time we need to track, analyze, and document the changing world of Microsoft 365 and Office 365. Only humans contribute to our work!
Why Does polyval Return Zero When the Coefficients are Empty?
polyval([],1)
polyval(ones(1,0),1)
Do those results follow from a mathematical justification or are they arbitrarily specified?polyval([],1)
polyval(ones(1,0),1)
Do those results follow from a mathematical justification or are they arbitrarily specified? polyval([],1)
polyval(ones(1,0),1)
Do those results follow from a mathematical justification or are they arbitrarily specified? polynomial, empty coefficients MATLAB Answers — New Questions
proper IFFT procedure for converting S-params into time domain reflectometry
Basic discontinuety was simulated 0Hz to 40Ghz 40000 samples as presented in the photos . S-parameters were extracted as S2P file(attached in the link). My goal is to see the discontinuety using time domain reflectometry. what is the proper way to do IFFT in this case? What windows should I multiply with? Thanks.Basic discontinuety was simulated 0Hz to 40Ghz 40000 samples as presented in the photos . S-parameters were extracted as S2P file(attached in the link). My goal is to see the discontinuety using time domain reflectometry. what is the proper way to do IFFT in this case? What windows should I multiply with? Thanks. Basic discontinuety was simulated 0Hz to 40Ghz 40000 samples as presented in the photos . S-parameters were extracted as S2P file(attached in the link). My goal is to see the discontinuety using time domain reflectometry. what is the proper way to do IFFT in this case? What windows should I multiply with? Thanks. ifft, tdr, s-parameters MATLAB Answers — New Questions
Multithreding causing system crashes on linux
Hello,
Im trying to run a rather heavy calculation on our server, and high levels of multithreading causes the system to crash, sadly without crash log. The system does not respond to anything, both over the network and pressing the power button, and requires the power connection to be pulled before it can restart.
The linux version is "Ubunto 24.04.2 LTS", with two AMD EPYC 7763 64-Core Processor CPUs, about 1 TB of ram, a GeForce RTX 3050 8GB graphics card and a Supermicro H12DSi-NT6 mainboard.
When I use parpool and maxNumCompThreads at 16, the system works fine, but rather slow. At 32, the system works fine for a couple of minutes, before crashing, even when the CPU and Ram load never goes above 20%.
The computations include ffts, interpolation and complex to real and vice versa conversions.
Do you have any tips or hints where I can check what is happening, or do you have any information what is going on and what I can do to resolve this problem?
ThanksHello,
Im trying to run a rather heavy calculation on our server, and high levels of multithreading causes the system to crash, sadly without crash log. The system does not respond to anything, both over the network and pressing the power button, and requires the power connection to be pulled before it can restart.
The linux version is "Ubunto 24.04.2 LTS", with two AMD EPYC 7763 64-Core Processor CPUs, about 1 TB of ram, a GeForce RTX 3050 8GB graphics card and a Supermicro H12DSi-NT6 mainboard.
When I use parpool and maxNumCompThreads at 16, the system works fine, but rather slow. At 32, the system works fine for a couple of minutes, before crashing, even when the CPU and Ram load never goes above 20%.
The computations include ffts, interpolation and complex to real and vice versa conversions.
Do you have any tips or hints where I can check what is happening, or do you have any information what is going on and what I can do to resolve this problem?
Thanks Hello,
Im trying to run a rather heavy calculation on our server, and high levels of multithreading causes the system to crash, sadly without crash log. The system does not respond to anything, both over the network and pressing the power button, and requires the power connection to be pulled before it can restart.
The linux version is "Ubunto 24.04.2 LTS", with two AMD EPYC 7763 64-Core Processor CPUs, about 1 TB of ram, a GeForce RTX 3050 8GB graphics card and a Supermicro H12DSi-NT6 mainboard.
When I use parpool and maxNumCompThreads at 16, the system works fine, but rather slow. At 32, the system works fine for a couple of minutes, before crashing, even when the CPU and Ram load never goes above 20%.
The computations include ffts, interpolation and complex to real and vice versa conversions.
Do you have any tips or hints where I can check what is happening, or do you have any information what is going on and what I can do to resolve this problem?
Thanks parfor, multithreading, error, performance MATLAB Answers — New Questions
I want to decrease the time my Script
Elapsed time is 8.597842 seconds.
clear, clc
tic
load(‘Erros_a.mat’); load(‘Sp1_b.mat’);
Relatorio = zeros(5000,4,’uint32′);
Relatorio_final = zeros(10000,4,’uint32′);
a = 10;
for i1 = 1:1
% BLOCO 1 — usa cache se existir, senão gera e salva
cache_file = sprintf(‘Erros_b_cache_%d.mat’, i1);
if exist(cache_file, ‘file’)
load(cache_file);
else
linha_a = Erros_a(a,:);
vals = linha_a(linha_a > 0);
vals = vals(1:end-2);
nRef = numel(vals);
cols_b1 = 2*(double(vals)-1) + 1;
cols_b2 = 2*(double(vals)-1) + 2;
passa = (Sp1_b(:, cols_b1) == 0) & (Sp1_b(:, cols_b2) == 0);
col_dest_matrix = uint32(cumsum(passa, 2) – passa + 1);
Erros_b = zeros(3268760, 37, ‘uint32’);
for d = 1:nRef
linhas_ok = find(passa(:, d));
if ~isempty(linhas_ok)
idx = sub2ind([3268760, 37], linhas_ok, double(col_dest_matrix(linhas_ok, d)));
Erros_b(idx) = vals(d);
end
end
save(cache_file, ‘Erros_b’, ‘-v7.3’);
end
% BLOCO 2 — preparação
load(‘Sp1_c.mat’);
Erros_b(:,38) = (1:size(Erros_b,1))’;
mascara = Erros_b(:, 13) > 50;
Erros_reduzido = Erros_b(mascara, :);
[lin_u, col_u] = find(Sp1_c == 1);
uns_nas_colunas = accumarray(col_u, lin_u, [size(Sp1_c,2) 1], @(x){sort(x)}, {[]});
clear Erros_b Sp1_c lin_u col_u mascara;
[~, ordem] = sortrows(Erros_reduzido(:, 1:38));
Erros_reduzido_ordem = Erros_reduzido(ordem, :);
[~, ordem] = sortrows(Erros_reduzido_ordem(:, 1:38));
Erros_reduzido_ordem = Erros_reduzido_ordem(ordem, :);
clear Erros_reduzido ordem;
ERO = double(Erros_reduzido_ordem);
clear Erros_reduzido_ordem;
nCols_c = numel(uns_nas_colunas);
uns_sets = cell(nCols_c, 1);
for cc = 1:nCols_c
s = uns_nas_colunas{cc};
if ~isempty(s)
m = false(max(s), 1);
m(s) = true;
uns_sets{cc} = m;
else
uns_sets{cc} = false(0,1);
end
end
% BLOCO 3 — while principal
num_linhas = size(ERO, 1);
y = 1;
offset = 0;
while (offset + 1) <= num_linhas
i = offset + 1;
linha_at = ERO(i, 1:38);
a_valid = linha_at(linha_at > 0 & linha_at <= 100);
% k=2: dois ponteiros
A = uns_nas_colunas{a_valid(1)};
B = uns_nas_colunas{a_valid(2)};
buf = zeros(min(numel(A), numel(B)), 1);
ia = 1; ib = 1; ic = 0;
na = numel(A); nb = numel(B);
while ia <= na && ib <= nb
if A(ia) == B(ib)
ic = ic + 1; buf(ic) = A(ia);
ia = ia + 1; ib = ib + 1;
elseif A(ia) < B(ib); ia = ia + 1;
else; ib = ib + 1;
end
end
candidatas = buf(1:ic);
w=1; z=1;
n(w,1) = a_valid(w,1);
achou = false;
if isempty(candidatas)
melhor_erro = a_valid(2) – 1;
melhor_linha = linha_at(38);
n(w,2) = a_valid(w,2);
nP = length(n);
lo = offset + 1; hi = num_linhas; ultlin_abs = offset;
if all(ERO(lo, 1:nP) == n)
while lo <= hi
mid = floor((lo + hi) / 2);
if all(ERO(mid, 1:nP) == n)
ultlin_abs = mid; lo = mid + 1;
else; hi = mid – 1; end
end
end
if ultlin_abs > offset; offset = ultlin_abs;
else; offset = offset + 1; end
n = [];
Relatorio(y,1) = Erros_a(i1,40);
Relatorio(y,2) = A(1);
Relatorio(y,3) = melhor_linha;
Relatorio(y,4) = melhor_erro;
y = y + 1;
achou = true;
end
% k>=3: lookup lógico
for k = 3:length(a_valid)
if achou; break; end
n(w,k-1) = a_valid(w,k-1);
col_atual = a_valid(k);
s2 = uns_sets{col_atual};
if isempty(candidatas) || isempty(s2)
proximas = [];
else
mask = candidatas <= numel(s2);
cand_validas = candidatas(mask);
if isempty(cand_validas); proximas = [];
else; proximas = cand_validas(s2(cand_validas)); end
end
if isempty(proximas)
melhor_erro = col_atual – 1;
melhor_linha = linha_at(38);
n(w,k) = a_valid(w,k);
nP = length(n);
lo = offset + 1; hi = num_linhas; ultlin_abs = offset;
if all(ERO(lo, 1:nP) == n)
while lo <= hi
mid = floor((lo + hi) / 2);
if all(ERO(mid, 1:nP) == n)
ultlin_abs = mid; lo = mid + 1;
else; hi = mid – 1; end
end
end
if ultlin_abs > offset; offset = ultlin_abs;
else; offset = offset + 1; end
n = [];
Relatorio(y,1) = Erros_a(i1,40);
Relatorio(y,2) = candidatas(1);
Relatorio(y,3) = melhor_linha;
Relatorio(y,4) = melhor_erro;
y = y + 1;
achou = true;
break;
end
candidatas = proximas;
melhor_linha = candidatas(1);
end % for k
if ~achou; offset = offset + 1; end
end % while
clear ERO uns_sets;
Relatorio = sortrows(Relatorio, 4, ‘descend’);
Relatorio_final(i1,:) = Relatorio(1,:);
Relatorio(:,:) = 0;
a = a + 1;
end % i1
tocElapsed time is 8.597842 seconds.
clear, clc
tic
load(‘Erros_a.mat’); load(‘Sp1_b.mat’);
Relatorio = zeros(5000,4,’uint32′);
Relatorio_final = zeros(10000,4,’uint32′);
a = 10;
for i1 = 1:1
% BLOCO 1 — usa cache se existir, senão gera e salva
cache_file = sprintf(‘Erros_b_cache_%d.mat’, i1);
if exist(cache_file, ‘file’)
load(cache_file);
else
linha_a = Erros_a(a,:);
vals = linha_a(linha_a > 0);
vals = vals(1:end-2);
nRef = numel(vals);
cols_b1 = 2*(double(vals)-1) + 1;
cols_b2 = 2*(double(vals)-1) + 2;
passa = (Sp1_b(:, cols_b1) == 0) & (Sp1_b(:, cols_b2) == 0);
col_dest_matrix = uint32(cumsum(passa, 2) – passa + 1);
Erros_b = zeros(3268760, 37, ‘uint32’);
for d = 1:nRef
linhas_ok = find(passa(:, d));
if ~isempty(linhas_ok)
idx = sub2ind([3268760, 37], linhas_ok, double(col_dest_matrix(linhas_ok, d)));
Erros_b(idx) = vals(d);
end
end
save(cache_file, ‘Erros_b’, ‘-v7.3’);
end
% BLOCO 2 — preparação
load(‘Sp1_c.mat’);
Erros_b(:,38) = (1:size(Erros_b,1))’;
mascara = Erros_b(:, 13) > 50;
Erros_reduzido = Erros_b(mascara, :);
[lin_u, col_u] = find(Sp1_c == 1);
uns_nas_colunas = accumarray(col_u, lin_u, [size(Sp1_c,2) 1], @(x){sort(x)}, {[]});
clear Erros_b Sp1_c lin_u col_u mascara;
[~, ordem] = sortrows(Erros_reduzido(:, 1:38));
Erros_reduzido_ordem = Erros_reduzido(ordem, :);
[~, ordem] = sortrows(Erros_reduzido_ordem(:, 1:38));
Erros_reduzido_ordem = Erros_reduzido_ordem(ordem, :);
clear Erros_reduzido ordem;
ERO = double(Erros_reduzido_ordem);
clear Erros_reduzido_ordem;
nCols_c = numel(uns_nas_colunas);
uns_sets = cell(nCols_c, 1);
for cc = 1:nCols_c
s = uns_nas_colunas{cc};
if ~isempty(s)
m = false(max(s), 1);
m(s) = true;
uns_sets{cc} = m;
else
uns_sets{cc} = false(0,1);
end
end
% BLOCO 3 — while principal
num_linhas = size(ERO, 1);
y = 1;
offset = 0;
while (offset + 1) <= num_linhas
i = offset + 1;
linha_at = ERO(i, 1:38);
a_valid = linha_at(linha_at > 0 & linha_at <= 100);
% k=2: dois ponteiros
A = uns_nas_colunas{a_valid(1)};
B = uns_nas_colunas{a_valid(2)};
buf = zeros(min(numel(A), numel(B)), 1);
ia = 1; ib = 1; ic = 0;
na = numel(A); nb = numel(B);
while ia <= na && ib <= nb
if A(ia) == B(ib)
ic = ic + 1; buf(ic) = A(ia);
ia = ia + 1; ib = ib + 1;
elseif A(ia) < B(ib); ia = ia + 1;
else; ib = ib + 1;
end
end
candidatas = buf(1:ic);
w=1; z=1;
n(w,1) = a_valid(w,1);
achou = false;
if isempty(candidatas)
melhor_erro = a_valid(2) – 1;
melhor_linha = linha_at(38);
n(w,2) = a_valid(w,2);
nP = length(n);
lo = offset + 1; hi = num_linhas; ultlin_abs = offset;
if all(ERO(lo, 1:nP) == n)
while lo <= hi
mid = floor((lo + hi) / 2);
if all(ERO(mid, 1:nP) == n)
ultlin_abs = mid; lo = mid + 1;
else; hi = mid – 1; end
end
end
if ultlin_abs > offset; offset = ultlin_abs;
else; offset = offset + 1; end
n = [];
Relatorio(y,1) = Erros_a(i1,40);
Relatorio(y,2) = A(1);
Relatorio(y,3) = melhor_linha;
Relatorio(y,4) = melhor_erro;
y = y + 1;
achou = true;
end
% k>=3: lookup lógico
for k = 3:length(a_valid)
if achou; break; end
n(w,k-1) = a_valid(w,k-1);
col_atual = a_valid(k);
s2 = uns_sets{col_atual};
if isempty(candidatas) || isempty(s2)
proximas = [];
else
mask = candidatas <= numel(s2);
cand_validas = candidatas(mask);
if isempty(cand_validas); proximas = [];
else; proximas = cand_validas(s2(cand_validas)); end
end
if isempty(proximas)
melhor_erro = col_atual – 1;
melhor_linha = linha_at(38);
n(w,k) = a_valid(w,k);
nP = length(n);
lo = offset + 1; hi = num_linhas; ultlin_abs = offset;
if all(ERO(lo, 1:nP) == n)
while lo <= hi
mid = floor((lo + hi) / 2);
if all(ERO(mid, 1:nP) == n)
ultlin_abs = mid; lo = mid + 1;
else; hi = mid – 1; end
end
end
if ultlin_abs > offset; offset = ultlin_abs;
else; offset = offset + 1; end
n = [];
Relatorio(y,1) = Erros_a(i1,40);
Relatorio(y,2) = candidatas(1);
Relatorio(y,3) = melhor_linha;
Relatorio(y,4) = melhor_erro;
y = y + 1;
achou = true;
break;
end
candidatas = proximas;
melhor_linha = candidatas(1);
end % for k
if ~achou; offset = offset + 1; end
end % while
clear ERO uns_sets;
Relatorio = sortrows(Relatorio, 4, ‘descend’);
Relatorio_final(i1,:) = Relatorio(1,:);
Relatorio(:,:) = 0;
a = a + 1;
end % i1
toc Elapsed time is 8.597842 seconds.
clear, clc
tic
load(‘Erros_a.mat’); load(‘Sp1_b.mat’);
Relatorio = zeros(5000,4,’uint32′);
Relatorio_final = zeros(10000,4,’uint32′);
a = 10;
for i1 = 1:1
% BLOCO 1 — usa cache se existir, senão gera e salva
cache_file = sprintf(‘Erros_b_cache_%d.mat’, i1);
if exist(cache_file, ‘file’)
load(cache_file);
else
linha_a = Erros_a(a,:);
vals = linha_a(linha_a > 0);
vals = vals(1:end-2);
nRef = numel(vals);
cols_b1 = 2*(double(vals)-1) + 1;
cols_b2 = 2*(double(vals)-1) + 2;
passa = (Sp1_b(:, cols_b1) == 0) & (Sp1_b(:, cols_b2) == 0);
col_dest_matrix = uint32(cumsum(passa, 2) – passa + 1);
Erros_b = zeros(3268760, 37, ‘uint32’);
for d = 1:nRef
linhas_ok = find(passa(:, d));
if ~isempty(linhas_ok)
idx = sub2ind([3268760, 37], linhas_ok, double(col_dest_matrix(linhas_ok, d)));
Erros_b(idx) = vals(d);
end
end
save(cache_file, ‘Erros_b’, ‘-v7.3’);
end
% BLOCO 2 — preparação
load(‘Sp1_c.mat’);
Erros_b(:,38) = (1:size(Erros_b,1))’;
mascara = Erros_b(:, 13) > 50;
Erros_reduzido = Erros_b(mascara, :);
[lin_u, col_u] = find(Sp1_c == 1);
uns_nas_colunas = accumarray(col_u, lin_u, [size(Sp1_c,2) 1], @(x){sort(x)}, {[]});
clear Erros_b Sp1_c lin_u col_u mascara;
[~, ordem] = sortrows(Erros_reduzido(:, 1:38));
Erros_reduzido_ordem = Erros_reduzido(ordem, :);
[~, ordem] = sortrows(Erros_reduzido_ordem(:, 1:38));
Erros_reduzido_ordem = Erros_reduzido_ordem(ordem, :);
clear Erros_reduzido ordem;
ERO = double(Erros_reduzido_ordem);
clear Erros_reduzido_ordem;
nCols_c = numel(uns_nas_colunas);
uns_sets = cell(nCols_c, 1);
for cc = 1:nCols_c
s = uns_nas_colunas{cc};
if ~isempty(s)
m = false(max(s), 1);
m(s) = true;
uns_sets{cc} = m;
else
uns_sets{cc} = false(0,1);
end
end
% BLOCO 3 — while principal
num_linhas = size(ERO, 1);
y = 1;
offset = 0;
while (offset + 1) <= num_linhas
i = offset + 1;
linha_at = ERO(i, 1:38);
a_valid = linha_at(linha_at > 0 & linha_at <= 100);
% k=2: dois ponteiros
A = uns_nas_colunas{a_valid(1)};
B = uns_nas_colunas{a_valid(2)};
buf = zeros(min(numel(A), numel(B)), 1);
ia = 1; ib = 1; ic = 0;
na = numel(A); nb = numel(B);
while ia <= na && ib <= nb
if A(ia) == B(ib)
ic = ic + 1; buf(ic) = A(ia);
ia = ia + 1; ib = ib + 1;
elseif A(ia) < B(ib); ia = ia + 1;
else; ib = ib + 1;
end
end
candidatas = buf(1:ic);
w=1; z=1;
n(w,1) = a_valid(w,1);
achou = false;
if isempty(candidatas)
melhor_erro = a_valid(2) – 1;
melhor_linha = linha_at(38);
n(w,2) = a_valid(w,2);
nP = length(n);
lo = offset + 1; hi = num_linhas; ultlin_abs = offset;
if all(ERO(lo, 1:nP) == n)
while lo <= hi
mid = floor((lo + hi) / 2);
if all(ERO(mid, 1:nP) == n)
ultlin_abs = mid; lo = mid + 1;
else; hi = mid – 1; end
end
end
if ultlin_abs > offset; offset = ultlin_abs;
else; offset = offset + 1; end
n = [];
Relatorio(y,1) = Erros_a(i1,40);
Relatorio(y,2) = A(1);
Relatorio(y,3) = melhor_linha;
Relatorio(y,4) = melhor_erro;
y = y + 1;
achou = true;
end
% k>=3: lookup lógico
for k = 3:length(a_valid)
if achou; break; end
n(w,k-1) = a_valid(w,k-1);
col_atual = a_valid(k);
s2 = uns_sets{col_atual};
if isempty(candidatas) || isempty(s2)
proximas = [];
else
mask = candidatas <= numel(s2);
cand_validas = candidatas(mask);
if isempty(cand_validas); proximas = [];
else; proximas = cand_validas(s2(cand_validas)); end
end
if isempty(proximas)
melhor_erro = col_atual – 1;
melhor_linha = linha_at(38);
n(w,k) = a_valid(w,k);
nP = length(n);
lo = offset + 1; hi = num_linhas; ultlin_abs = offset;
if all(ERO(lo, 1:nP) == n)
while lo <= hi
mid = floor((lo + hi) / 2);
if all(ERO(mid, 1:nP) == n)
ultlin_abs = mid; lo = mid + 1;
else; hi = mid – 1; end
end
end
if ultlin_abs > offset; offset = ultlin_abs;
else; offset = offset + 1; end
n = [];
Relatorio(y,1) = Erros_a(i1,40);
Relatorio(y,2) = candidatas(1);
Relatorio(y,3) = melhor_linha;
Relatorio(y,4) = melhor_erro;
y = y + 1;
achou = true;
break;
end
candidatas = proximas;
melhor_linha = candidatas(1);
end % for k
if ~achou; offset = offset + 1; end
end % while
clear ERO uns_sets;
Relatorio = sortrows(Relatorio, 4, ‘descend’);
Relatorio_final(i1,:) = Relatorio(1,:);
Relatorio(:,:) = 0;
a = a + 1;
end % i1
toc script slow MATLAB Answers — New Questions
“operation not allowed” when accessing network drive
I get an "operation not allowed" error in Matlab (only in Matlab) on MacOS when trying to access network-mounted RAID drive
Desktop Mac (1) running Macos 26.3.1, has network-mounted a USB-C external RAID drive connected to older desktop Mac (2) running 15.7.4.
I can view, edit, save etc. files on the (remote) RAID system using terminal windows on (1), using Finder, TextEdit, etc.. But attempting to access folders or files from within Matlab R2024b returns the error "operation not allowed".
Both systems (1) & (2) have Matlab given "full disk access" in Settings>Privacy&Security>FullDiskAccess. Both systems have user given read&write access for shared network drive in Finder>Get_Info, in Unix permissions, and in Settings>Sharing>File_Sharing.
Matlab on (2) can read & write files on the (locally-attached) RAID drive. The problem is only when trying to access the RAID drive from within in Matlab on (1).
smbd also has full disk access (as is clear since terminal and other apps can read & write RAID drive over network connection).
Any suggestions would be appreciated.I get an "operation not allowed" error in Matlab (only in Matlab) on MacOS when trying to access network-mounted RAID drive
Desktop Mac (1) running Macos 26.3.1, has network-mounted a USB-C external RAID drive connected to older desktop Mac (2) running 15.7.4.
I can view, edit, save etc. files on the (remote) RAID system using terminal windows on (1), using Finder, TextEdit, etc.. But attempting to access folders or files from within Matlab R2024b returns the error "operation not allowed".
Both systems (1) & (2) have Matlab given "full disk access" in Settings>Privacy&Security>FullDiskAccess. Both systems have user given read&write access for shared network drive in Finder>Get_Info, in Unix permissions, and in Settings>Sharing>File_Sharing.
Matlab on (2) can read & write files on the (locally-attached) RAID drive. The problem is only when trying to access the RAID drive from within in Matlab on (1).
smbd also has full disk access (as is clear since terminal and other apps can read & write RAID drive over network connection).
Any suggestions would be appreciated. I get an "operation not allowed" error in Matlab (only in Matlab) on MacOS when trying to access network-mounted RAID drive
Desktop Mac (1) running Macos 26.3.1, has network-mounted a USB-C external RAID drive connected to older desktop Mac (2) running 15.7.4.
I can view, edit, save etc. files on the (remote) RAID system using terminal windows on (1), using Finder, TextEdit, etc.. But attempting to access folders or files from within Matlab R2024b returns the error "operation not allowed".
Both systems (1) & (2) have Matlab given "full disk access" in Settings>Privacy&Security>FullDiskAccess. Both systems have user given read&write access for shared network drive in Finder>Get_Info, in Unix permissions, and in Settings>Sharing>File_Sharing.
Matlab on (2) can read & write files on the (locally-attached) RAID drive. The problem is only when trying to access the RAID drive from within in Matlab on (1).
smbd also has full disk access (as is clear since terminal and other apps can read & write RAID drive over network connection).
Any suggestions would be appreciated. operation not allowed MATLAB Answers — New Questions
How to sign an .mlapp app packaged using MATLAB App designer?
Using Share to "Standalone Desktop App" in MATLAB App Designer, Is there a way to sign the installer .exe file that is generated, and also sign the application .exe file that is generated after the installation file is run? Currently, when using App Designer to package the app, it creates a build of the app and then packages it into an installation .exe file in the same workflow.
The issue I’m forseeing is that if I sign the installation .exe file, the application .exe file within will still be un-signed when it is generated after the installer is run. Am I right in thinking this? If so, is there a method of ensuring the application .exe file within is signed?Using Share to "Standalone Desktop App" in MATLAB App Designer, Is there a way to sign the installer .exe file that is generated, and also sign the application .exe file that is generated after the installation file is run? Currently, when using App Designer to package the app, it creates a build of the app and then packages it into an installation .exe file in the same workflow.
The issue I’m forseeing is that if I sign the installation .exe file, the application .exe file within will still be un-signed when it is generated after the installer is run. Am I right in thinking this? If so, is there a method of ensuring the application .exe file within is signed? Using Share to "Standalone Desktop App" in MATLAB App Designer, Is there a way to sign the installer .exe file that is generated, and also sign the application .exe file that is generated after the installation file is run? Currently, when using App Designer to package the app, it creates a build of the app and then packages it into an installation .exe file in the same workflow.
The issue I’m forseeing is that if I sign the installation .exe file, the application .exe file within will still be un-signed when it is generated after the installer is run. Am I right in thinking this? If so, is there a method of ensuring the application .exe file within is signed? app designer, compiler, certificate, signing MATLAB Answers — New Questions
How do I determine the linear part of a force-displacement curve?
I have a force-displacement graph (the attached file) and I want to find out exactly at what point the linear portion of the graph ends. Please see the picture for more clarification.
I’ve already smoothed out the curve, so it is noiseless.
I did a quick search but couldn’t find anything useful.
Any help would be highly appreciated.I have a force-displacement graph (the attached file) and I want to find out exactly at what point the linear portion of the graph ends. Please see the picture for more clarification.
I’ve already smoothed out the curve, so it is noiseless.
I did a quick search but couldn’t find anything useful.
Any help would be highly appreciated. I have a force-displacement graph (the attached file) and I want to find out exactly at what point the linear portion of the graph ends. Please see the picture for more clarification.
I’ve already smoothed out the curve, so it is noiseless.
I did a quick search but couldn’t find anything useful.
Any help would be highly appreciated. linear part, nonlinear part MATLAB Answers — New Questions
Best way to relabel axis as pi for trig functions.
Hi all, I was looking for ways to relabel my x-axis as pi increments for trig functions and was wondering which one would be most effective.
This is what chatgpt gave, but I wanted to see if there are any better ways to achieve the same result. TIA!!
clc, clearvars
x = linspace(0,2*pi,200);
y = sin(x);
% Plot
figure
hold on
plot(x, y)
% Pi Labeling
xt = 0:pi/2:2*pi;
xticks(xt)
label = compose(‘%g\pi’, xt/pi);
xticklabels(label)Hi all, I was looking for ways to relabel my x-axis as pi increments for trig functions and was wondering which one would be most effective.
This is what chatgpt gave, but I wanted to see if there are any better ways to achieve the same result. TIA!!
clc, clearvars
x = linspace(0,2*pi,200);
y = sin(x);
% Plot
figure
hold on
plot(x, y)
% Pi Labeling
xt = 0:pi/2:2*pi;
xticks(xt)
label = compose(‘%g\pi’, xt/pi);
xticklabels(label) Hi all, I was looking for ways to relabel my x-axis as pi increments for trig functions and was wondering which one would be most effective.
This is what chatgpt gave, but I wanted to see if there are any better ways to achieve the same result. TIA!!
clc, clearvars
x = linspace(0,2*pi,200);
y = sin(x);
% Plot
figure
hold on
plot(x, y)
% Pi Labeling
xt = 0:pi/2:2*pi;
xticks(xt)
label = compose(‘%g\pi’, xt/pi);
xticklabels(label) xtick, label, trigonometry, pi MATLAB Answers — New Questions
Probléme sur mon programme matlab avec la fonction lsqcurvefit
Bonjour la communauté,
enfaite présentatement je travail sur un programme qui permets de recueillir les paramétre du modèle de Cole_cole à partir des mesures que j’ai eu. Donc l’idéé c’est de faire un programme qui va tracer une courbe qui se superpose à la mesure et me donner les paramétre du modèle correspondant. là j’utilise le lsqcurvefit mais le programme me retourne les valeurs d’initialisation et je sais pas ca peut être dû quoi ?
Merci d’avance de votre réponseBonjour la communauté,
enfaite présentatement je travail sur un programme qui permets de recueillir les paramétre du modèle de Cole_cole à partir des mesures que j’ai eu. Donc l’idéé c’est de faire un programme qui va tracer une courbe qui se superpose à la mesure et me donner les paramétre du modèle correspondant. là j’utilise le lsqcurvefit mais le programme me retourne les valeurs d’initialisation et je sais pas ca peut être dû quoi ?
Merci d’avance de votre réponse Bonjour la communauté,
enfaite présentatement je travail sur un programme qui permets de recueillir les paramétre du modèle de Cole_cole à partir des mesures que j’ai eu. Donc l’idéé c’est de faire un programme qui va tracer une courbe qui se superpose à la mesure et me donner les paramétre du modèle correspondant. là j’utilise le lsqcurvefit mais le programme me retourne les valeurs d’initialisation et je sais pas ca peut être dû quoi ?
Merci d’avance de votre réponse mbengue MATLAB Answers — New Questions
“Index exceeds 37” when 35 variables?
So, I’ve been trying to do 3 variable modeling in MATLAB. I have four sets of data (3 variables and one answer), and I’m trying to bet an equation modeling the data. When running the section of the code pasted below, I keep getting "Index exceeds number of array elements. Index must not exceed 37". There are only 35 variables in the code, so I’m not sure why this isn’t working. As far as why I chose this format, I think x and z can be modeled by a quadratic individually, but I figured each variable needed to be the same power, so they’re all 4th power. Any help would be greatly appreciated.
ft = fittype([ …
‘p000 + p100*x + p010*y + p001*z + ‘ …
‘p200*x.^2 + p020*y.^2 + p002*z.^2 + ‘ …
‘p110*x*y + p101*x*z + p011*y*z + ‘ …
‘p300*x.^3 + p030*y.^3 + p003*z.^3 + ‘ …
‘p210*x.^2*y + p201*x.^2*z + p120*x*y.^2 + ‘ …
‘p021*y.^2*z + p102*x*z.^2 + p012*y*z.^2 + ‘ …
‘p111*x*y*z + ‘ …
‘p400*x.^4 + p040*y.^4 + p004*z.^4 + ‘ …
‘p310*x.^3*y + p301*x.^3*z + p130*x*y.^3 + ‘ …
‘p031*y.^3*z + p103*x*z.^3 + p013*y*z.^3 + ‘ …
‘p220*x.^2*y.^2 + p202*x.^2*z.^2 + p022*y.^2*z.^2 + ‘ …
‘p211*x.^2*y*z + p121*x*y.^2*z + p112*x*y*z.^2’], …
‘independent’, {‘x’, ‘y’, ‘z’}, …
‘dependent’, ‘v’);
[fitobject, gof, output] = fit([x, y, z], v, ft);
disp(fitobject)So, I’ve been trying to do 3 variable modeling in MATLAB. I have four sets of data (3 variables and one answer), and I’m trying to bet an equation modeling the data. When running the section of the code pasted below, I keep getting "Index exceeds number of array elements. Index must not exceed 37". There are only 35 variables in the code, so I’m not sure why this isn’t working. As far as why I chose this format, I think x and z can be modeled by a quadratic individually, but I figured each variable needed to be the same power, so they’re all 4th power. Any help would be greatly appreciated.
ft = fittype([ …
‘p000 + p100*x + p010*y + p001*z + ‘ …
‘p200*x.^2 + p020*y.^2 + p002*z.^2 + ‘ …
‘p110*x*y + p101*x*z + p011*y*z + ‘ …
‘p300*x.^3 + p030*y.^3 + p003*z.^3 + ‘ …
‘p210*x.^2*y + p201*x.^2*z + p120*x*y.^2 + ‘ …
‘p021*y.^2*z + p102*x*z.^2 + p012*y*z.^2 + ‘ …
‘p111*x*y*z + ‘ …
‘p400*x.^4 + p040*y.^4 + p004*z.^4 + ‘ …
‘p310*x.^3*y + p301*x.^3*z + p130*x*y.^3 + ‘ …
‘p031*y.^3*z + p103*x*z.^3 + p013*y*z.^3 + ‘ …
‘p220*x.^2*y.^2 + p202*x.^2*z.^2 + p022*y.^2*z.^2 + ‘ …
‘p211*x.^2*y*z + p121*x*y.^2*z + p112*x*y*z.^2’], …
‘independent’, {‘x’, ‘y’, ‘z’}, …
‘dependent’, ‘v’);
[fitobject, gof, output] = fit([x, y, z], v, ft);
disp(fitobject) So, I’ve been trying to do 3 variable modeling in MATLAB. I have four sets of data (3 variables and one answer), and I’m trying to bet an equation modeling the data. When running the section of the code pasted below, I keep getting "Index exceeds number of array elements. Index must not exceed 37". There are only 35 variables in the code, so I’m not sure why this isn’t working. As far as why I chose this format, I think x and z can be modeled by a quadratic individually, but I figured each variable needed to be the same power, so they’re all 4th power. Any help would be greatly appreciated.
ft = fittype([ …
‘p000 + p100*x + p010*y + p001*z + ‘ …
‘p200*x.^2 + p020*y.^2 + p002*z.^2 + ‘ …
‘p110*x*y + p101*x*z + p011*y*z + ‘ …
‘p300*x.^3 + p030*y.^3 + p003*z.^3 + ‘ …
‘p210*x.^2*y + p201*x.^2*z + p120*x*y.^2 + ‘ …
‘p021*y.^2*z + p102*x*z.^2 + p012*y*z.^2 + ‘ …
‘p111*x*y*z + ‘ …
‘p400*x.^4 + p040*y.^4 + p004*z.^4 + ‘ …
‘p310*x.^3*y + p301*x.^3*z + p130*x*y.^3 + ‘ …
‘p031*y.^3*z + p103*x*z.^3 + p013*y*z.^3 + ‘ …
‘p220*x.^2*y.^2 + p202*x.^2*z.^2 + p022*y.^2*z.^2 + ‘ …
‘p211*x.^2*y*z + p121*x*y.^2*z + p112*x*y*z.^2’], …
‘independent’, {‘x’, ‘y’, ‘z’}, …
‘dependent’, ‘v’);
[fitobject, gof, output] = fit([x, y, z], v, ft);
disp(fitobject) error, curve fitting MATLAB Answers — New Questions
The Retirement of SharePoint Alerts is a Pain in the Rear
SharePoint Rules Just Don’t Do It for Me
Can I say that I hate the abolishment of SharePoint alerts (MC1072889, last updated 22 October 2025) and their replacement by SharePoint rules? Alerts haven’t quite gone yet, but we are well along the path to final retirement in July 2026. Starting in January 2026, Microsoft started to disable the creation of new alerts, and existing alerts are subject to a rule expiration policy which means that alerts must be renewed (“extended”) every 30 days. A non-functional alert is all too easy to miss if someone fails to extend its operation.
Seeking an Alternative
Microsoft suggests that users transition alerts to SharePoint Rules or Power Automate. They say that the removal of SharePoint alerts will “streamline and modernize user notifications. With Power Automate, organizations can benefit from an enhanced, versatile solution that goes beyond traditional alerts, offering seamless integration across Microsoft 365 services and more.”
This is so much hogwash. It is marketing twaddle at its finest and part of the general encouragement to use Power Automate, which might then lead to agents and the grand Agent 365 vision laid out at the Ignite 2025 conference.
My need is straightforward and seemingly simple. I want to receive a digest via email of all the changes made to files in a document library generated daily. I use the digest to track author activity for the Office 365 for IT Pros eBook so that I know when an author has updated one or more chapters that must then be integrated into the book (Figure 1).

It is easy to create the email digest with SharePoint Alerts (Figure 2). The alert has been running without a problem for the last seven years.

Microsoft’s Suggestions Don’t Work for Me
Power Automate can do great things with data drawn from across Microsoft 365. It has very powerful capabilities in skilled hands, but it’s maybe not the right kind of tool to replace the simplicity of SharePoint Alerts for average users. As a test, I used the When an item in a SharePoint list is modified send an email template and used it to create a flow to notify me about file updates. The flow works for individual changes, but I see no way to recreate the daily digest of changes.
SharePoint Rules boasts an updated interface to replace the old 2010-style interface used by SharePoint alerts. The UX is simple to use but doesn’t seem able to create the daily digest either. I can certainly generate a rule to send email when a file is updated in a document library. However, the rule results in large numbers of messages for even short editing sessions (the flow has the same problem).
The root cause is AutoSave, a tremendous feature that removes the possibility of losing file content due to software bugs, hardware crashes, or a reboot caused by a software update. AutoSave is also the basis for collaborative co-authoring, so it’s a very powerful and useful feature. The only downside is that AutoSave creates multiple file versions during an editing session, which is why Microsoft introduced intelligent versioning to restrict the number of versions retained for files.
Look at Figure 3 – my SharePoint rule sent 71 messages to advise of changes made to files when I reviewed a single chapter to accept author changes and transpose the updates to the book.

Desperately Seeking a Digest
I’ve searched the internet to find suggestions about how to make Power Automate or SharePoint Rules create an emailed daily digest of changes made to files in a document library and haven’t found anything. Perhaps there’s someone out there who knows the magic necessary to make either do the job. If so, that would be great.
What’s annoying here is that in Microsoft’s rush to remove SharePoint Alerts, they forgot to make sure that the alternative solutions cover all bases. SharePoint Rules seems to be far more focused on handling situations that arise in Lists than file updates (I know that a file update is a list update under the covers). A new glitzy UX for SharePoint Rules and the flexibility of Power Automate are nothing to me if I can’t convert my trusty alert. And that’s a real pity.
Learn about managing SharePoint Online and the rest of the Microsoft 365 ecosystem by subscribing to the Office 365 for IT Pros eBook. Use our experience to understand what’s important and how best to protect your tenant.
How to use AI to edit UI of app using AppDesigner
We are building an app with AppDesigner (24b currently). To get help designing we are using AI features. The suggestions seem good, and I want to adapt my AppDesigner Code. However, the code of the UI is greyed out. Secondly, unzipping the .mlapp and editing the matlab/document.xml does not work, as zipping again creates an not running (and smaller in size) .mlapp file. Is there a way to get access to the UI Code and to edit it effectively? Thank you.We are building an app with AppDesigner (24b currently). To get help designing we are using AI features. The suggestions seem good, and I want to adapt my AppDesigner Code. However, the code of the UI is greyed out. Secondly, unzipping the .mlapp and editing the matlab/document.xml does not work, as zipping again creates an not running (and smaller in size) .mlapp file. Is there a way to get access to the UI Code and to edit it effectively? Thank you. We are building an app with AppDesigner (24b currently). To get help designing we are using AI features. The suggestions seem good, and I want to adapt my AppDesigner Code. However, the code of the UI is greyed out. Secondly, unzipping the .mlapp and editing the matlab/document.xml does not work, as zipping again creates an not running (and smaller in size) .mlapp file. Is there a way to get access to the UI Code and to edit it effectively? Thank you. appdesigner, ai MATLAB Answers — New Questions
Why is Jaaba stuck open on MATLAB online?
I was trying to run JAABA and realized I don’t have the correct video file format yet, but when I tried to exit out of the dialog box that comes up it is completely frozen. I can’t type or select anything in matlab online and even when I close out of it and reopen the dialog box is still stuck there. Thank you!I was trying to run JAABA and realized I don’t have the correct video file format yet, but when I tried to exit out of the dialog box that comes up it is completely frozen. I can’t type or select anything in matlab online and even when I close out of it and reopen the dialog box is still stuck there. Thank you! I was trying to run JAABA and realized I don’t have the correct video file format yet, but when I tried to exit out of the dialog box that comes up it is completely frozen. I can’t type or select anything in matlab online and even when I close out of it and reopen the dialog box is still stuck there. Thank you! jaaba, frozen, stuck MATLAB Answers — New Questions









