Month: March 2026
How do I install additional toolboxes into an existing installation of MATLAB?
New toolboxes have just been added to my license. How do I install additional toolboxes into an existing installation of MATLAB?New toolboxes have just been added to my license. How do I install additional toolboxes into an existing installation of MATLAB? New toolboxes have just been added to my license. How do I install additional toolboxes into an existing installation of MATLAB? MATLAB Answers — New Questions
Undefined function ‘imhistc’ for input arguments of type ‘uint8’.
Im trying to get the histogram of an image using imhist. however its showing the above error? i tried which imhistc and its not found. Im using matlab R2016Im trying to get the histogram of an image using imhist. however its showing the above error? i tried which imhistc and its not found. Im using matlab R2016 Im trying to get the histogram of an image using imhist. however its showing the above error? i tried which imhistc and its not found. Im using matlab R2016 matlab, histogram MATLAB Answers — New Questions
Microsoft Limits App Access to Sensitive Message Properties
Apps Won’t Be Able to Update Sensitive Message Properties
In an interesting and understandable move, Microsoft announced on March 24 that apps using the update message Graph API will be restricted from updating sensitive properties for non-draft messages from December 31, 2026.
A sensitive property can be defined as one that is expected to remain immutable after the originator sends the message like its subject or content. The documentation for the update message API highlights these properties as “updatable only if isDraft = true” (Figure 1).

App Access to Message Properties
It’s easy to understand why an app shouldn’t add TO, CC, or BCC recipients to a sent message or amend the body (text) of a message while it’s acceptable to update the categories, follow up flag, or importance. Apps often update these properties for their own purposes. For instance, an app tracking customer requests flowing into a shared mailbox might update categories as agents (human or computer) process requests.
Obviously, it appears that some apps have been updating the sensitive properties and that’s a bad thing if done without good reason. For example, adding a recipient to a sent message won’t deliver a message to that recipient’s mailbox (because the message has already been through the transport pipeline), but anyone looking at the message would assume that the added recipient had seen it. This creates an obvious compliance issue for eDiscovery, communications compliance, and other areas.
Change to Required Graph Permissions
Up to now, the Mail.ReadWrite Graph permission has been sufficient to allow an app to update messages. Use of this permission should be restricted by RBAC for Applications as otherwise the app has full access to update items in any mailbox.
After December 31, 2026, apps can continue to update non-sensitive message properties via the Mail.ReadWrite permission, but if those apps want to update sensitive properties for non-draft messages, apps must be assigned and receive administrator consent for an appropriate advanced mail access permission:
- Mail-Advanced.ReadWrite (delegated).
- Mail-Advanced.ReadWrite.All (application access to normal mailboxes).
- Mail-Advanced.ReadWrite.All.Shared (application access to shared mailboxes).
At the date of writing, only the Mail-Advanced.ReadWrite.All permission is visible in the Entra Admin center (Figure 2).

Sample Code to Update Message Properties
To illustrate the point, let’s update some message properties. Everything below can be done by an app with the Mail.ReadWrite permission. First, retrieve some messages from a mail folder. In this case, the code fetches the latest message from the Sent Items folder.
$Message = Get-MgUserMailFolderMessage -UserId $Userid -Top 1 -MailFolderId SentItems -Property Id, categories, subject, body, ccRecipients, toRecipients
Now create a hash table containing the new values for the properties that you want to update (including some sensitive properties) and use the Update-MgUserMessage cmdlet to update the message. Notice how even the message body can be updated.
$Body = @{}
$Body.Add("contentType", "HTML")
$Body.Add("content", "<b>Kilroy Was Here and Messed this message up!</b>")
$Properties = @{}
$Properties.Add("subject", "An odd message changed from the Graph")
$Properties.Add("categories", "Happiness")
$Properties.Add("Body", $Body)
Update-MgUserMessage -MessageId $Message.Id -UserId $UserId -BodyParameter $Properties
Updating recipients (always sensitive) is harder unless you decide to overwrite the existing recipient information. This code extracts the current CC recipients and adds a new recipient before updating the message. Recipient information is always passed in an array of hash tables, which each hash table holding the details of a recipient.
[array]$CCRecipients = $null
ForEach ($Recipient in $Message.ccRecipients) {
$RecipientInfo = @{}
$EmailAddress = @{}
$EmailAddress.Add("address", $Recipient.emailAddress.address)
$EmailAddress.Add("name", $Recipient.emailAddress.name)
$RecipientInfo.Add("emailaddress", $EmailAddress)
$CCRecipients += $RecipientInfo
}
$NewCCRecipient = @{}
$EmailAddress = @{}
$EmailAddress.Add("address", 'Ken.Bowers@office365itpros.com')
$NewCCRecipient.Add("emailaddress", $EmailAddress)
$CCRecipients += $NewCCRecipients
Update-MgUserMessage -MessageId $Message.Id -UserId $UserId -CcRecipients $CCRecipients
Figure 3 shows a message with properties updated by the code example.

The only property that the app can update using this code after 31 December 2026 will be categories. Everything else requires the app to have an advanced mail permission.
What Action to Take Now
The only way to discover if a tenant has any apps (registered or enterprise) with the Mail.ReadWrite permission is to check permission assignments. Retrieving and checking permission assignments is boring manual work. Fortunately, PowerShell can automate the process.
Use the analysis script explained in this article to check for service principals with high-priority permission assignments, which include Mail.ReadWrite. Then ask what justification exists for apps to have the assignment. If justification exists, make plans for the apps to be assigned the appropriate advanced mail permission before December 31. Otherwise, the apps will stop working when their permissions become invalid.
So much change, all the time. It’s a challenge to stay abreast of all the updates Microsoft makes across the Microsoft 365 ecosystem. Subscribe to the Office 365 for IT Pros eBook to receive insights updated monthly into what happens within Microsoft 365, why it happens, and what new features and capabilities mean for your tenant.
Simulink Multiplatform Code Generation
I use a FMU inside a Simulink model from which I want to generate code, how could I generate multiplatform code of this Simulink model including the FMU? For example for Linux and CPU ARM.
Thank you very much in advance.
Best regards,
Víctor Sánchez SuárezI use a FMU inside a Simulink model from which I want to generate code, how could I generate multiplatform code of this Simulink model including the FMU? For example for Linux and CPU ARM.
Thank you very much in advance.
Best regards,
Víctor Sánchez Suárez I use a FMU inside a Simulink model from which I want to generate code, how could I generate multiplatform code of this Simulink model including the FMU? For example for Linux and CPU ARM.
Thank you very much in advance.
Best regards,
Víctor Sánchez Suárez code generation, simulink, fmu MATLAB Answers — New Questions
Question about loading multiple files
Greetings,
I wrote an ‘m’ function to load several files recursively and do some processing/graphing.
If I declare the file names in a string array, then the code executes with no issue.
However, if I load all files with the dir() function, I get an error message after the 1st file is loaded. What am I missing?
DIR_STR=dir(‘*.mf4’);
FILES= DIR_STR.name
for ii=1:5
FILE=FILES(ii,:)
disp([‘ii = ‘ num2str(ii) ‘ — File: ‘ FILE])
endGreetings,
I wrote an ‘m’ function to load several files recursively and do some processing/graphing.
If I declare the file names in a string array, then the code executes with no issue.
However, if I load all files with the dir() function, I get an error message after the 1st file is loaded. What am I missing?
DIR_STR=dir(‘*.mf4’);
FILES= DIR_STR.name
for ii=1:5
FILE=FILES(ii,:)
disp([‘ii = ‘ num2str(ii) ‘ — File: ‘ FILE])
end Greetings,
I wrote an ‘m’ function to load several files recursively and do some processing/graphing.
If I declare the file names in a string array, then the code executes with no issue.
However, if I load all files with the dir() function, I get an error message after the 1st file is loaded. What am I missing?
DIR_STR=dir(‘*.mf4’);
FILES= DIR_STR.name
for ii=1:5
FILE=FILES(ii,:)
disp([‘ii = ‘ num2str(ii) ‘ — File: ‘ FILE])
end loading multiple files MATLAB Answers — New Questions
Kinks/discontinuities in pdepe solution
Hello everyone,
I’ve been working with Matlab pdepe to solve numerically a set of coupled partial differential equations. I’m fairly new and I’ve encountered a problem with the numerical solution that I get from my code and can’t seem to get rid of it. The equations model the diffusion and decay of two species in a material over 100s of ns. The problem I’m getting is that when I look at the solution in a log time scale, several kinks appear. Here are different things I’ve tried and haven’t helped:
Make tspan finer. (30-1000 points)
Make xmesh finer. (50-1000 points)
Increase or decrease relative tolerance (1E0 to 1E-6).
Make tspan time separation linear after t = 0.
Make tspan time separation increase logarithmically after t = 0.1 s
Any insights into how I could solve the problem would be useful.
% Physical constants
%params = [DR TR TT A B];
DR_guess = 1E6; % in nm^2 /ns
DT_guess = 1E1; % in nm^2 /ns
TR_guess = 14; % in ns
TT_guess = 130; % in ns
T0 = 295; % in K
R0 = 0.016;% in e/nm^3
A = 1;
B = 200;
Y = 0.3056;
CR = -80000;
CT = 220;
params = [DR_guess DT_guess TR_guess TT_guess T0 R0 A B Y CR CT];
% Setting up the mesh for space and time
xmesh = linspace(0,2000,55); %in nm
tspan = [-5, -2, -1, -0.5, 0, logspace(-1, 3, 80)];% in ns
% Solving the differential equation
options = odeset(‘RelTol’,1e-0,’OutputFcn’,@myOut,’Stats’,’on’);
pde = @(x, t, u, dudx) AgSepde(x, t, u, dudx, params);
soln = pdepe(1, pde, @AgSeic, @AgSebc, xmesh, tspan, options);
% Partial differential equation function
function [c,f,s] = AgSepde(x,t,u,dudx,params)
% Parameters for PDEs
DR = params(1);
DT = params(2);
TR = params(3);
TT = params(4);
T0 = params(5);
R0 = params(6);
A = params(7);
B = params(8);
Y = params(9);
% Generation function
sigmar = 180; % in nm
sigmat = 0.2; %in ns
t0 = 0.00; % in ns
G = (1 / (sigmar * sqrt(2*pi))) * exp(-x.^2 / (2 * sigmar^2)) …
* (1 / (sigmat * sqrt(2*pi))) * exp(-(t – t0).^2 / (2 * sigmat^2));
c = [1; 1];
f = [DR*dudx(1); DT*dudx(2)];
s = [-(u(1) – R0)/TR + A*G; Y*(u(1)- R0) – (u(2) – T0)/TT + B*G];
end
% Intial conditions for the PDEs
function u0 = AgSeic(x)
T0 = 295;
R0 = 0.016;
u0 = [R0; T0];
end
function [pl, ql, pr, qr] = AgSebc(xl, ul, xr, ur, t)
% Left boundary: u(0,t) = 1
pl = [0; 0];
ql = [1; 1];
% Right boundary: u(x’,t) = 0
pr = [0; 0];
qr = [1; 1];
end
function status = myOut(t,y,flag)
persistent last
if strcmp(flag,’init’), last = tic; end
if isempty(flag) && toc(last) > 1
fprintf(‘t = %.3g nsn’, t(end));
last = tic;
end
status = 0;
end
%% Figures
tiledlayout(2,1)
nexttile(1,[1,1])
hold on;
plot(tspan,soln(:,1,1),’Marker’,’o’);
set(gca,’XScale’,’log’);
xlabel(‘Time / ns’);
ylabel(‘Species 1’);
hold off;
nexttile(2,[1,1])
hold on;
plot(tspan,soln(:,1,2),’Marker’,’square’)
set(gca,’XScale’,’log’);
xlabel(‘Time / ns’);
ylabel(‘Species 2’);
hold off;Hello everyone,
I’ve been working with Matlab pdepe to solve numerically a set of coupled partial differential equations. I’m fairly new and I’ve encountered a problem with the numerical solution that I get from my code and can’t seem to get rid of it. The equations model the diffusion and decay of two species in a material over 100s of ns. The problem I’m getting is that when I look at the solution in a log time scale, several kinks appear. Here are different things I’ve tried and haven’t helped:
Make tspan finer. (30-1000 points)
Make xmesh finer. (50-1000 points)
Increase or decrease relative tolerance (1E0 to 1E-6).
Make tspan time separation linear after t = 0.
Make tspan time separation increase logarithmically after t = 0.1 s
Any insights into how I could solve the problem would be useful.
% Physical constants
%params = [DR TR TT A B];
DR_guess = 1E6; % in nm^2 /ns
DT_guess = 1E1; % in nm^2 /ns
TR_guess = 14; % in ns
TT_guess = 130; % in ns
T0 = 295; % in K
R0 = 0.016;% in e/nm^3
A = 1;
B = 200;
Y = 0.3056;
CR = -80000;
CT = 220;
params = [DR_guess DT_guess TR_guess TT_guess T0 R0 A B Y CR CT];
% Setting up the mesh for space and time
xmesh = linspace(0,2000,55); %in nm
tspan = [-5, -2, -1, -0.5, 0, logspace(-1, 3, 80)];% in ns
% Solving the differential equation
options = odeset(‘RelTol’,1e-0,’OutputFcn’,@myOut,’Stats’,’on’);
pde = @(x, t, u, dudx) AgSepde(x, t, u, dudx, params);
soln = pdepe(1, pde, @AgSeic, @AgSebc, xmesh, tspan, options);
% Partial differential equation function
function [c,f,s] = AgSepde(x,t,u,dudx,params)
% Parameters for PDEs
DR = params(1);
DT = params(2);
TR = params(3);
TT = params(4);
T0 = params(5);
R0 = params(6);
A = params(7);
B = params(8);
Y = params(9);
% Generation function
sigmar = 180; % in nm
sigmat = 0.2; %in ns
t0 = 0.00; % in ns
G = (1 / (sigmar * sqrt(2*pi))) * exp(-x.^2 / (2 * sigmar^2)) …
* (1 / (sigmat * sqrt(2*pi))) * exp(-(t – t0).^2 / (2 * sigmat^2));
c = [1; 1];
f = [DR*dudx(1); DT*dudx(2)];
s = [-(u(1) – R0)/TR + A*G; Y*(u(1)- R0) – (u(2) – T0)/TT + B*G];
end
% Intial conditions for the PDEs
function u0 = AgSeic(x)
T0 = 295;
R0 = 0.016;
u0 = [R0; T0];
end
function [pl, ql, pr, qr] = AgSebc(xl, ul, xr, ur, t)
% Left boundary: u(0,t) = 1
pl = [0; 0];
ql = [1; 1];
% Right boundary: u(x’,t) = 0
pr = [0; 0];
qr = [1; 1];
end
function status = myOut(t,y,flag)
persistent last
if strcmp(flag,’init’), last = tic; end
if isempty(flag) && toc(last) > 1
fprintf(‘t = %.3g nsn’, t(end));
last = tic;
end
status = 0;
end
%% Figures
tiledlayout(2,1)
nexttile(1,[1,1])
hold on;
plot(tspan,soln(:,1,1),’Marker’,’o’);
set(gca,’XScale’,’log’);
xlabel(‘Time / ns’);
ylabel(‘Species 1’);
hold off;
nexttile(2,[1,1])
hold on;
plot(tspan,soln(:,1,2),’Marker’,’square’)
set(gca,’XScale’,’log’);
xlabel(‘Time / ns’);
ylabel(‘Species 2’);
hold off; Hello everyone,
I’ve been working with Matlab pdepe to solve numerically a set of coupled partial differential equations. I’m fairly new and I’ve encountered a problem with the numerical solution that I get from my code and can’t seem to get rid of it. The equations model the diffusion and decay of two species in a material over 100s of ns. The problem I’m getting is that when I look at the solution in a log time scale, several kinks appear. Here are different things I’ve tried and haven’t helped:
Make tspan finer. (30-1000 points)
Make xmesh finer. (50-1000 points)
Increase or decrease relative tolerance (1E0 to 1E-6).
Make tspan time separation linear after t = 0.
Make tspan time separation increase logarithmically after t = 0.1 s
Any insights into how I could solve the problem would be useful.
% Physical constants
%params = [DR TR TT A B];
DR_guess = 1E6; % in nm^2 /ns
DT_guess = 1E1; % in nm^2 /ns
TR_guess = 14; % in ns
TT_guess = 130; % in ns
T0 = 295; % in K
R0 = 0.016;% in e/nm^3
A = 1;
B = 200;
Y = 0.3056;
CR = -80000;
CT = 220;
params = [DR_guess DT_guess TR_guess TT_guess T0 R0 A B Y CR CT];
% Setting up the mesh for space and time
xmesh = linspace(0,2000,55); %in nm
tspan = [-5, -2, -1, -0.5, 0, logspace(-1, 3, 80)];% in ns
% Solving the differential equation
options = odeset(‘RelTol’,1e-0,’OutputFcn’,@myOut,’Stats’,’on’);
pde = @(x, t, u, dudx) AgSepde(x, t, u, dudx, params);
soln = pdepe(1, pde, @AgSeic, @AgSebc, xmesh, tspan, options);
% Partial differential equation function
function [c,f,s] = AgSepde(x,t,u,dudx,params)
% Parameters for PDEs
DR = params(1);
DT = params(2);
TR = params(3);
TT = params(4);
T0 = params(5);
R0 = params(6);
A = params(7);
B = params(8);
Y = params(9);
% Generation function
sigmar = 180; % in nm
sigmat = 0.2; %in ns
t0 = 0.00; % in ns
G = (1 / (sigmar * sqrt(2*pi))) * exp(-x.^2 / (2 * sigmar^2)) …
* (1 / (sigmat * sqrt(2*pi))) * exp(-(t – t0).^2 / (2 * sigmat^2));
c = [1; 1];
f = [DR*dudx(1); DT*dudx(2)];
s = [-(u(1) – R0)/TR + A*G; Y*(u(1)- R0) – (u(2) – T0)/TT + B*G];
end
% Intial conditions for the PDEs
function u0 = AgSeic(x)
T0 = 295;
R0 = 0.016;
u0 = [R0; T0];
end
function [pl, ql, pr, qr] = AgSebc(xl, ul, xr, ur, t)
% Left boundary: u(0,t) = 1
pl = [0; 0];
ql = [1; 1];
% Right boundary: u(x’,t) = 0
pr = [0; 0];
qr = [1; 1];
end
function status = myOut(t,y,flag)
persistent last
if strcmp(flag,’init’), last = tic; end
if isempty(flag) && toc(last) > 1
fprintf(‘t = %.3g nsn’, t(end));
last = tic;
end
status = 0;
end
%% Figures
tiledlayout(2,1)
nexttile(1,[1,1])
hold on;
plot(tspan,soln(:,1,1),’Marker’,’o’);
set(gca,’XScale’,’log’);
xlabel(‘Time / ns’);
ylabel(‘Species 1’);
hold off;
nexttile(2,[1,1])
hold on;
plot(tspan,soln(:,1,2),’Marker’,’square’)
set(gca,’XScale’,’log’);
xlabel(‘Time / ns’);
ylabel(‘Species 2’);
hold off; pde, pdepe MATLAB Answers — New Questions
New Microsoft Defender Revelation Reopens Troubling Quality Questions
Entra ID Login Events Fail to Get to Defender for Cloud Apps
Microsoft’s recent message center post MC1253510 is the kind of disclosure that deserves more attention than it’s likely to get. Microsoft has revealed that Entra ID login events from February 17, 2025, through November 17, 2025— a nine-month period— were not being sent to Microsoft Defender for Cloud Applications (MDA – Figure 1). That’s nine months of missing security telemetry in a product that organizations pay for specifically because it provides visibility into user sign-in behavior.

Microsoft sent notifications to affected tenants with the subject line “Data privacy notification available in Message Center.” Tenants who were not affected (e.g. because they don’t use MDA) won’t see this notification.
What Happened to Microsoft Defender for Cloud Apps
According to the message center post, a code issue introduced on February 17, 2025, caused a subset of Entra ID login events to stop flowing into the MDA portal. Microsoft deployed a fix on November 30, 2025, and says that the fix “restored processing for all affected Entra ID login events.”
The affected capabilities include activity viewing, activity alerts, advanced hunting, anomaly detection, Microsoft Sentinel integration (for MDA-sourced data paths), and file policy evaluation. In other words, the full range of things you’d use MDA for when investigating user sign-in activity.
Microsoft says the data itself was never lost — it remained on Microsoft’s servers and was always accessible through the Entra portal and through the EntraSignInEvents table in Advanced Hunting. The gap was specifically in the pipeline that feeds login events to MDA. I’m not sure that’s actually comforting.
Why This Is a Problem
Let’s be direct about what this means: organizations that were depending on Defender for Cloud Apps didn’t get the security protection they paid for. During that time, Defender for Cloud Apps didn’t correctly detect some number of anomalous sign-ins, trigger alerts on suspicious logins, or feed sign-in signals into Sentinel.
This is a security product. Incomplete telemetry in a security product isn’t just an inconvenience. It’s a fundamental failure, because it could allow attackers to work without triggering the alerts that MDA is supposed to generate.
A brief outage in a data pipeline is understandable; cloud services are complex, and things break. But a nine-month duration is unacceptable. The length of the gap suggests that either the data pipeline lacked adequate monitoring, or the monitoring existed but nobody acted on it.
Neither explanation is reassuring for a security product, especially given Microsoft’s loud public focus on improving product and platform security.
Microsoft’s Disclosure Timeline Raises Questions
The fix was deployed on November 30, 2025. The message center post disclosing the issue was published on March 16, 2026 — more than three and a half months after the fix. Microsoft frames the disclosure as “part of [their] commitment to transparency and service reliability.” That… sounds wrong.
On one hand, yes, transparency is welcome, so it’s good that Microsoft disclosed this issue.
On the other hand, a 14-week gap in making the actual disclosure is excessive. Microsoft had already fixed the problem at that point, so there was no issue of responsible disclosure. Meanwhile, customers that ran an investigation between February and November 2025 that depended on MDA sign-in data must now question the validity of the results they got.
The post says “no further action is required” from customers because Microsoft has resolved the underlying issue. That’s true in the narrow sense that the pipeline is fixed. But organizations that conducted security investigations, compliance reviews, or audit responses during the affected period using MDA data absolutely have follow-up work to do. They need to assess whether any conclusions drawn from MDA sign-in data during those nine months were affected by the gap.
If I were an MDCA customer, I would also be assessing whether I wanted to switch products.
What You Should Do
If you’re using MDA as part of your infrastructure, there are a few things you should do to ensure that the pipeline issue didn’t affect you.
- Review investigations conducted during the affected period. If your security team or compliance team ran investigations between February 17 and November 17, 2025, that relied on Entra ID sign-in data from MDA, flag them for review.
- Cross-reference with Entra ID logs. Microsoft confirms that the sign-in data was always available through the Entra portal and the EntraSignInEvents table in Advanced Hunting. If you find gaps in your MDA-based investigation data, you can fill them from these sources — assuming your log retention policies still cover the affected period.
- Check your Sentinel integration. If you feed MDA data into Microsoft Sentinel, review whether your detection rules and hunting queries that depend on MDA-sourced sign-in events produced accurate results during the affected window. Sentinel queries that pull directly from Entra (rather than through MDA) would not have been affected.
- Review your anomaly detection baselines. MDA’s anomaly detection builds behavioral baselines from historical data. Nine months of incomplete sign-in data could have skewed those baselines. Monitor whether your anomaly detection produces an unusual number of false positives or negatives in the weeks following the fix as the models recalibrate.
- Document the gap for your auditors. If your organization is subject to compliance frameworks that require continuous monitoring of sign-in activity (SOC 2, ISO 27001, various regulatory requirements), document this gap and your remediation steps. Your auditors will want to see that you’ve assessed the impact.
The Bigger Picture
This incident is part of a pattern. Microsoft’s security products are powerful, but the company’s track record on timely disclosure of data pipeline issues and service gaps has been uneven. The Copilot DLP bug from earlier this year — where confidential email content leaked through Copilot Chat despite sensitivity labels — took weeks to acknowledge after customers first reported it. Now we have a nine-month data gap disclosed three and a half months after the fix.
Organizations building their security posture on Microsoft’s cloud security stack need to account for the possibility that these products occasionally fail silently. That means maintaining independent verification processes, cross-referencing data sources, and not assuming that the absence of alerts means the absence of threats. It also means treating “no action required” disclosures from Microsoft with a healthy dose of skepticism — because “no action required by Microsoft” and “no action required by your security team” are very different statements.
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.
What would be the sample time for PRBS input in model estimation, if sample time for signals has an offset , e.g. [3.33e-5,1.67e-5]
I am interested in obtaining a bode plot for a system which has signals sampled at [3.33e-5,1.67e-5], as shown below(sample time is encircled in red, and signals in green)
what would I specify the sample time for the PRBS signal for estimation?
The sample time of the PRBS,signal and signals of interest should be the same for estimation to work, however if I specify the sample time as [3.33e-5,1.67e-5 ], it throws a error, saying that the sample time should be a double.
Writing sample time as 3.33e-5, does not work either, as there is error during compliation that sample times are different.How can I get around this problem to obtain a bode plot?I am interested in obtaining a bode plot for a system which has signals sampled at [3.33e-5,1.67e-5], as shown below(sample time is encircled in red, and signals in green)
what would I specify the sample time for the PRBS signal for estimation?
The sample time of the PRBS,signal and signals of interest should be the same for estimation to work, however if I specify the sample time as [3.33e-5,1.67e-5 ], it throws a error, saying that the sample time should be a double.
Writing sample time as 3.33e-5, does not work either, as there is error during compliation that sample times are different.How can I get around this problem to obtain a bode plot? I am interested in obtaining a bode plot for a system which has signals sampled at [3.33e-5,1.67e-5], as shown below(sample time is encircled in red, and signals in green)
what would I specify the sample time for the PRBS signal for estimation?
The sample time of the PRBS,signal and signals of interest should be the same for estimation to work, however if I specify the sample time as [3.33e-5,1.67e-5 ], it throws a error, saying that the sample time should be a double.
Writing sample time as 3.33e-5, does not work either, as there is error during compliation that sample times are different.How can I get around this problem to obtain a bode plot? simulink, model linearizer, estimation, bode plot, smps MATLAB Answers — New Questions
guidance on code structure improvement
I would like to know if this code can be improved/optimized. is it well-written? Any help will be appreciated. Thanks
function main_solver_optimized()
params.alpha = 0.04; params.beta = 1e4; params.gamma = 3e7;
y0 = [1; 0; 0];
tspan = [0, 1e6];
h0 = 1e-4;
tol = 1e-2;
fprintf(‘Running Part 1: Radau IIA (2-stage vs 3-stage)…n’);
[T1, Y1, s1, r1] = solve_robertson(y0, tspan, h0, tol, params, ‘Radau’);
fprintf(‘Running Part 2: SDIRK 3(4)…n’);
[T2, Y2, s2, r2] = solve_robertson(y0, tspan, h0, tol, params, ‘SDIRK’);
fprintf(‘n================ RESULTS COMPARISON ================n’);
fprintf(‘Method | Successful Steps | Rejected Stepsn’);
fprintf(‘—————————————————-n’);
fprintf(‘Radau IIA | %16d | %14dn’, s1, r1);
fprintf(‘SDIRK 3(4) | %16d | %14dn’, s2, r2);
fprintf(‘====================================================n’);
figure(‘Name’, ‘Robertson Problem Solutions’);
subplot(2,1,1);
semilogx(T1, Y1(:,1), T1, Y1(:,2)*1e4, T1, Y1(:,3), ‘LineWidth’, 1.5);
title(‘Part 1: Radau IIA Method’); xlabel(‘Time (s)’); ylabel(‘Concentration’);
legend(‘y_1’, ‘y_2 times 10^4’, ‘y_3’, ‘Location’, ‘Best’); grid on;
subplot(2,1,2);
semilogx(T2, Y2(:,1), T2, Y2(:,2)*1e4, T2, Y2(:,3), ‘LineWidth’, 1.5);
title(‘Part 2: SDIRK 3(4) Method’); xlabel(‘Time (s)’); ylabel(‘Concentration’);
legend(‘y_1’, ‘y_2 times 10^4’, ‘y_3’, ‘Location’, ‘Best’); grid on;
end
function [T, Y, success, rejected] = solve_robertson(y0, tspan, h, tol, p, method)
Nmax = 1e6;
T = zeros(Nmax,1); Y = zeros(Nmax,3);
t = tspan(1); y = y0;
T(1) = t; Y(1,:) = y’;
stepCount = 1;
success = 0; rejected = 0;
if strcmp(method,’Radau’)
A2 = [5/12, -1/12; 3/4, 1/4]; c2 = [1/3, 1]’;
sq6 = sqrt(6);
A3 = [(88-7*sq6)/360, (296-169*sq6)/1800, (-2+3*sq6)/225; …
(296+169*sq6)/1800, (88+7*sq6)/360, (-2-3*sq6)/225; …
(16-sq6)/36, (16+sq6)/36, 1/9];
c3 = [(4-sq6)/10, (4+sq6)/10, 1]’;
solver_func = @(y,h) solve_radau_adaptive(y,h,A2,c2,A3,c3,p);
order_p = 3;
else
gam = 1/4;
A = [gam, 0, 0, 0, 0;
1/2-gam, gam, 0, 0, 0;
2*gam, 1-4*gam, gam, 0, 0;
1/10, 1/10, 1/10+gam, gam, 0;
1/4, 1/4, 0, 1/4, gam];
c = [1/4, 3/4, 11/20, 1/2, 1]’;
b = [1/4, 1/4, 0, 1/4, 1/4];
bhat = [-3/16, 5/8, 3/16, 1/16, 5/16];
solver_func = @(y,h) solve_sdirk_sequential(y,h,A,b,bhat,c,p);
order_p = 3;
end
while t < tspan(2)
if t + h > tspan(2), h = tspan(2) – t; end
[y_n, y_hat, converged] = solver_func(y,h);
if converged
err = max(abs(y_n – y_hat));
if err <= tol
t = t + h; y = y_n;
stepCount = stepCount + 1;
T(stepCount) = t;
Y(stepCount,:) = y’;
success = success + 1;
h = h * min(5, max(0.1, 0.9*(tol/err)^(1/(order_p+1))));
else
h = h/4; rejected = rejected + 1;
end
else
h = h/4; rejected = rejected + 1;
end
end
T = T(1:stepCount); Y = Y(1:stepCount,:);
end
function [ynext, yhat, conv] = solve_radau_adaptive(y, h, A2, c2, A3, c3, p)
ynext = y + 0;
yhat = y + 0;
conv = true;
end
function [ynext, yhat, conv] = solve_sdirk_sequential(y, h, A, b, bhat, c, p)
s = length(c);
K = zeros(3,s);
conv = true;
for i = 1:s
ki = zeros(3,1);
rhs = y + h*(K(:,1:i-1)*A(i,1:i-1)’);
for iter = 1:5
val = rhs + h*A(i,i)*ki;
f_val = [-p.alpha*val(1) + p.beta*val(2)*val(3); …
p.alpha*val(1) – p.beta*val(2)*val(3) – p.gamma*val(2)^2; …
p.gamma*val(2)^2];
jac = [-p.alpha, p.beta*val(3), p.beta*val(2); …
p.alpha, -p.beta*val(3)-2*p.gamma*val(2), -p.beta*val(2); …
0, 2*p.gamma*val(2), 0];
F = ki – f_val;
DF = eye(3) – h*A(i,i)*jac;
step = DFF;
ki = ki – step;
if max(abs(step)) < 1e-8, break; end
if iter == 5, conv = false; end
end
K(:,i) = ki;
end
ynext = y + h*(K*b’);
yhat = y + h*(K*bhat’);
endI would like to know if this code can be improved/optimized. is it well-written? Any help will be appreciated. Thanks
function main_solver_optimized()
params.alpha = 0.04; params.beta = 1e4; params.gamma = 3e7;
y0 = [1; 0; 0];
tspan = [0, 1e6];
h0 = 1e-4;
tol = 1e-2;
fprintf(‘Running Part 1: Radau IIA (2-stage vs 3-stage)…n’);
[T1, Y1, s1, r1] = solve_robertson(y0, tspan, h0, tol, params, ‘Radau’);
fprintf(‘Running Part 2: SDIRK 3(4)…n’);
[T2, Y2, s2, r2] = solve_robertson(y0, tspan, h0, tol, params, ‘SDIRK’);
fprintf(‘n================ RESULTS COMPARISON ================n’);
fprintf(‘Method | Successful Steps | Rejected Stepsn’);
fprintf(‘—————————————————-n’);
fprintf(‘Radau IIA | %16d | %14dn’, s1, r1);
fprintf(‘SDIRK 3(4) | %16d | %14dn’, s2, r2);
fprintf(‘====================================================n’);
figure(‘Name’, ‘Robertson Problem Solutions’);
subplot(2,1,1);
semilogx(T1, Y1(:,1), T1, Y1(:,2)*1e4, T1, Y1(:,3), ‘LineWidth’, 1.5);
title(‘Part 1: Radau IIA Method’); xlabel(‘Time (s)’); ylabel(‘Concentration’);
legend(‘y_1’, ‘y_2 times 10^4’, ‘y_3’, ‘Location’, ‘Best’); grid on;
subplot(2,1,2);
semilogx(T2, Y2(:,1), T2, Y2(:,2)*1e4, T2, Y2(:,3), ‘LineWidth’, 1.5);
title(‘Part 2: SDIRK 3(4) Method’); xlabel(‘Time (s)’); ylabel(‘Concentration’);
legend(‘y_1’, ‘y_2 times 10^4’, ‘y_3’, ‘Location’, ‘Best’); grid on;
end
function [T, Y, success, rejected] = solve_robertson(y0, tspan, h, tol, p, method)
Nmax = 1e6;
T = zeros(Nmax,1); Y = zeros(Nmax,3);
t = tspan(1); y = y0;
T(1) = t; Y(1,:) = y’;
stepCount = 1;
success = 0; rejected = 0;
if strcmp(method,’Radau’)
A2 = [5/12, -1/12; 3/4, 1/4]; c2 = [1/3, 1]’;
sq6 = sqrt(6);
A3 = [(88-7*sq6)/360, (296-169*sq6)/1800, (-2+3*sq6)/225; …
(296+169*sq6)/1800, (88+7*sq6)/360, (-2-3*sq6)/225; …
(16-sq6)/36, (16+sq6)/36, 1/9];
c3 = [(4-sq6)/10, (4+sq6)/10, 1]’;
solver_func = @(y,h) solve_radau_adaptive(y,h,A2,c2,A3,c3,p);
order_p = 3;
else
gam = 1/4;
A = [gam, 0, 0, 0, 0;
1/2-gam, gam, 0, 0, 0;
2*gam, 1-4*gam, gam, 0, 0;
1/10, 1/10, 1/10+gam, gam, 0;
1/4, 1/4, 0, 1/4, gam];
c = [1/4, 3/4, 11/20, 1/2, 1]’;
b = [1/4, 1/4, 0, 1/4, 1/4];
bhat = [-3/16, 5/8, 3/16, 1/16, 5/16];
solver_func = @(y,h) solve_sdirk_sequential(y,h,A,b,bhat,c,p);
order_p = 3;
end
while t < tspan(2)
if t + h > tspan(2), h = tspan(2) – t; end
[y_n, y_hat, converged] = solver_func(y,h);
if converged
err = max(abs(y_n – y_hat));
if err <= tol
t = t + h; y = y_n;
stepCount = stepCount + 1;
T(stepCount) = t;
Y(stepCount,:) = y’;
success = success + 1;
h = h * min(5, max(0.1, 0.9*(tol/err)^(1/(order_p+1))));
else
h = h/4; rejected = rejected + 1;
end
else
h = h/4; rejected = rejected + 1;
end
end
T = T(1:stepCount); Y = Y(1:stepCount,:);
end
function [ynext, yhat, conv] = solve_radau_adaptive(y, h, A2, c2, A3, c3, p)
ynext = y + 0;
yhat = y + 0;
conv = true;
end
function [ynext, yhat, conv] = solve_sdirk_sequential(y, h, A, b, bhat, c, p)
s = length(c);
K = zeros(3,s);
conv = true;
for i = 1:s
ki = zeros(3,1);
rhs = y + h*(K(:,1:i-1)*A(i,1:i-1)’);
for iter = 1:5
val = rhs + h*A(i,i)*ki;
f_val = [-p.alpha*val(1) + p.beta*val(2)*val(3); …
p.alpha*val(1) – p.beta*val(2)*val(3) – p.gamma*val(2)^2; …
p.gamma*val(2)^2];
jac = [-p.alpha, p.beta*val(3), p.beta*val(2); …
p.alpha, -p.beta*val(3)-2*p.gamma*val(2), -p.beta*val(2); …
0, 2*p.gamma*val(2), 0];
F = ki – f_val;
DF = eye(3) – h*A(i,i)*jac;
step = DFF;
ki = ki – step;
if max(abs(step)) < 1e-8, break; end
if iter == 5, conv = false; end
end
K(:,i) = ki;
end
ynext = y + h*(K*b’);
yhat = y + h*(K*bhat’);
end I would like to know if this code can be improved/optimized. is it well-written? Any help will be appreciated. Thanks
function main_solver_optimized()
params.alpha = 0.04; params.beta = 1e4; params.gamma = 3e7;
y0 = [1; 0; 0];
tspan = [0, 1e6];
h0 = 1e-4;
tol = 1e-2;
fprintf(‘Running Part 1: Radau IIA (2-stage vs 3-stage)…n’);
[T1, Y1, s1, r1] = solve_robertson(y0, tspan, h0, tol, params, ‘Radau’);
fprintf(‘Running Part 2: SDIRK 3(4)…n’);
[T2, Y2, s2, r2] = solve_robertson(y0, tspan, h0, tol, params, ‘SDIRK’);
fprintf(‘n================ RESULTS COMPARISON ================n’);
fprintf(‘Method | Successful Steps | Rejected Stepsn’);
fprintf(‘—————————————————-n’);
fprintf(‘Radau IIA | %16d | %14dn’, s1, r1);
fprintf(‘SDIRK 3(4) | %16d | %14dn’, s2, r2);
fprintf(‘====================================================n’);
figure(‘Name’, ‘Robertson Problem Solutions’);
subplot(2,1,1);
semilogx(T1, Y1(:,1), T1, Y1(:,2)*1e4, T1, Y1(:,3), ‘LineWidth’, 1.5);
title(‘Part 1: Radau IIA Method’); xlabel(‘Time (s)’); ylabel(‘Concentration’);
legend(‘y_1’, ‘y_2 times 10^4’, ‘y_3’, ‘Location’, ‘Best’); grid on;
subplot(2,1,2);
semilogx(T2, Y2(:,1), T2, Y2(:,2)*1e4, T2, Y2(:,3), ‘LineWidth’, 1.5);
title(‘Part 2: SDIRK 3(4) Method’); xlabel(‘Time (s)’); ylabel(‘Concentration’);
legend(‘y_1’, ‘y_2 times 10^4’, ‘y_3’, ‘Location’, ‘Best’); grid on;
end
function [T, Y, success, rejected] = solve_robertson(y0, tspan, h, tol, p, method)
Nmax = 1e6;
T = zeros(Nmax,1); Y = zeros(Nmax,3);
t = tspan(1); y = y0;
T(1) = t; Y(1,:) = y’;
stepCount = 1;
success = 0; rejected = 0;
if strcmp(method,’Radau’)
A2 = [5/12, -1/12; 3/4, 1/4]; c2 = [1/3, 1]’;
sq6 = sqrt(6);
A3 = [(88-7*sq6)/360, (296-169*sq6)/1800, (-2+3*sq6)/225; …
(296+169*sq6)/1800, (88+7*sq6)/360, (-2-3*sq6)/225; …
(16-sq6)/36, (16+sq6)/36, 1/9];
c3 = [(4-sq6)/10, (4+sq6)/10, 1]’;
solver_func = @(y,h) solve_radau_adaptive(y,h,A2,c2,A3,c3,p);
order_p = 3;
else
gam = 1/4;
A = [gam, 0, 0, 0, 0;
1/2-gam, gam, 0, 0, 0;
2*gam, 1-4*gam, gam, 0, 0;
1/10, 1/10, 1/10+gam, gam, 0;
1/4, 1/4, 0, 1/4, gam];
c = [1/4, 3/4, 11/20, 1/2, 1]’;
b = [1/4, 1/4, 0, 1/4, 1/4];
bhat = [-3/16, 5/8, 3/16, 1/16, 5/16];
solver_func = @(y,h) solve_sdirk_sequential(y,h,A,b,bhat,c,p);
order_p = 3;
end
while t < tspan(2)
if t + h > tspan(2), h = tspan(2) – t; end
[y_n, y_hat, converged] = solver_func(y,h);
if converged
err = max(abs(y_n – y_hat));
if err <= tol
t = t + h; y = y_n;
stepCount = stepCount + 1;
T(stepCount) = t;
Y(stepCount,:) = y’;
success = success + 1;
h = h * min(5, max(0.1, 0.9*(tol/err)^(1/(order_p+1))));
else
h = h/4; rejected = rejected + 1;
end
else
h = h/4; rejected = rejected + 1;
end
end
T = T(1:stepCount); Y = Y(1:stepCount,:);
end
function [ynext, yhat, conv] = solve_radau_adaptive(y, h, A2, c2, A3, c3, p)
ynext = y + 0;
yhat = y + 0;
conv = true;
end
function [ynext, yhat, conv] = solve_sdirk_sequential(y, h, A, b, bhat, c, p)
s = length(c);
K = zeros(3,s);
conv = true;
for i = 1:s
ki = zeros(3,1);
rhs = y + h*(K(:,1:i-1)*A(i,1:i-1)’);
for iter = 1:5
val = rhs + h*A(i,i)*ki;
f_val = [-p.alpha*val(1) + p.beta*val(2)*val(3); …
p.alpha*val(1) – p.beta*val(2)*val(3) – p.gamma*val(2)^2; …
p.gamma*val(2)^2];
jac = [-p.alpha, p.beta*val(3), p.beta*val(2); …
p.alpha, -p.beta*val(3)-2*p.gamma*val(2), -p.beta*val(2); …
0, 2*p.gamma*val(2), 0];
F = ki – f_val;
DF = eye(3) – h*A(i,i)*jac;
step = DFF;
ki = ki – step;
if max(abs(step)) < 1e-8, break; end
if iter == 5, conv = false; end
end
K(:,i) = ki;
end
ynext = y + h*(K*b’);
yhat = y + h*(K*bhat’);
end code improvement MATLAB Answers — New Questions
Matlab crash
Hello!
I have a weird bug when debugging a code in MATLAB.
I start debugging single commands (using F10), and when I want to run the rest of the code by pressing F5 I get a MATLAB system error:
"MATLAB has encountered an internal problem and need to close" containing several options (Sending the information to MathWorks, Attempt to Continue, see more details and ‘End Now’ for closing the program).
I tried sending the error to MathWorks but their answer didn’t help.
In order to continue working I need to end the program and restart it. It doesn’t happen every time, but it happens a lot.
Version details:
MATLAB Version: 7.11.0.584 (R2010b)
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode.
Did someone ever encounter a similar problem?
Thanks!Hello!
I have a weird bug when debugging a code in MATLAB.
I start debugging single commands (using F10), and when I want to run the rest of the code by pressing F5 I get a MATLAB system error:
"MATLAB has encountered an internal problem and need to close" containing several options (Sending the information to MathWorks, Attempt to Continue, see more details and ‘End Now’ for closing the program).
I tried sending the error to MathWorks but their answer didn’t help.
In order to continue working I need to end the program and restart it. It doesn’t happen every time, but it happens a lot.
Version details:
MATLAB Version: 7.11.0.584 (R2010b)
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode.
Did someone ever encounter a similar problem?
Thanks! Hello!
I have a weird bug when debugging a code in MATLAB.
I start debugging single commands (using F10), and when I want to run the rest of the code by pressing F5 I get a MATLAB system error:
"MATLAB has encountered an internal problem and need to close" containing several options (Sending the information to MathWorks, Attempt to Continue, see more details and ‘End Now’ for closing the program).
I tried sending the error to MathWorks but their answer didn’t help.
In order to continue working I need to end the program and restart it. It doesn’t happen every time, but it happens a lot.
Version details:
MATLAB Version: 7.11.0.584 (R2010b)
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode.
Did someone ever encounter a similar problem?
Thanks! debugging, error MATLAB Answers — New Questions
pwelch method of power spectral density (psd) calculation
I have a question on the pwelch method for power spectral density computation in Matlab that is not clarified in the documentation for pwelch.
My usage : pxx = pwelch(x, window, noverlap, nfft)
If nfft is larger than the length of window, I believe MATLAB pads each windowed segment with zeros so that the FFT is taken on nfft points. Please confirm.
What happens when nfft is smaller than the window length? Is the window size truncated to match nfft?
pwelch appears to scale the DFT here appropriately with number of samples of the nfft (N) and frequency spacing as opposed to a regular DFT in Matlab that is not scaled, pl confirm.
Is there a way to output the number of averages performed when pwelch is called as above?
Thanks.I have a question on the pwelch method for power spectral density computation in Matlab that is not clarified in the documentation for pwelch.
My usage : pxx = pwelch(x, window, noverlap, nfft)
If nfft is larger than the length of window, I believe MATLAB pads each windowed segment with zeros so that the FFT is taken on nfft points. Please confirm.
What happens when nfft is smaller than the window length? Is the window size truncated to match nfft?
pwelch appears to scale the DFT here appropriately with number of samples of the nfft (N) and frequency spacing as opposed to a regular DFT in Matlab that is not scaled, pl confirm.
Is there a way to output the number of averages performed when pwelch is called as above?
Thanks. I have a question on the pwelch method for power spectral density computation in Matlab that is not clarified in the documentation for pwelch.
My usage : pxx = pwelch(x, window, noverlap, nfft)
If nfft is larger than the length of window, I believe MATLAB pads each windowed segment with zeros so that the FFT is taken on nfft points. Please confirm.
What happens when nfft is smaller than the window length? Is the window size truncated to match nfft?
pwelch appears to scale the DFT here appropriately with number of samples of the nfft (N) and frequency spacing as opposed to a regular DFT in Matlab that is not scaled, pl confirm.
Is there a way to output the number of averages performed when pwelch is called as above?
Thanks. pwelch, psd, fft MATLAB Answers — New Questions
ChatGPT Enterprise Apps Grab Some Work IQ
ChatGPT Enterprise Apps for Email, Teams, and Calendar Use Graph to Fetch User Data
One of the more bizarre responses I received after questioning the state of the Microsoft Graph last week was the thought that Microsoft might be slowing the progress of the Graph APIs to stymie the apps developed by OpenAI to allow ChatGPT enterprise to access user email, calendar, and Teams items. The most recent development for the ChatGPT apps adds write access, with OpenAI saying that “You can now use apps like Microsoft Outlook email to draft emails for you, Google docs and sheets to create spreadsheets or docs, or setup meetings using the respective calendar apps.”
Being able to ask Outlook to draft emails or setup meetings in your calendar comes perilously close the kind of functionality boasted by Microsoft 365 Copilot as it seeks to exploit Work IQ, “the intelligence layer that personalizes Microsoft 365 Copilot to you and your organization.” Basically, if ChatGPT apps can extract data from user mailboxes and Teams, ChatGPT can add its own intelligence. Right now, the level of that intelligence is not the same as Microsoft 365 Copilot because Copilot can leverage the full range of Graph APIs to build a picture of what’s important to a user, but OpenAI is progressing.
ChatGPT Enterprise Apps Access to Microsoft 365 Content
Today, ChatGPT enterprise customers can install Entra ID apps created by OpenAI to access:
- SharePoint Online and OneDrive for Business.
- Mailbox items, including user calendars.
- Teams chats, channel messages, and tasks.
These are enterprise apps and are managed at that level. ChatGPT also has user-level apps that allow anyone with even the ChatGPT free plan to connect to SharePoint Online and OneDrive for Business. Entra ID blocks users from being able to grant access to sites and files, but an administrator can install the ChatGPT app (Figure 1) and grant the app delegated access to sites and files. Any user in a tenant can then upload files from SharePoint Online or OneDrive for Business to ChatGPT for processing.

If you unexpectedly find the ChatGPT app in your tenant, the simplest solution is to deactivate the app and find out which users scream about losing access to ChatGPT. Or simply delete the app (the ChatGPT app is easily recreated if necessary).
ChatGPT Enterprise Applications
The ChatGPT enterprise apps use the same technique with different permissions to access the target data. Having access to files, email, calendar, and Teams messages is a lot of valuable data for an AI product to be able to reason over. Granting that level of access to third-party apps raises all sorts of compliance issues, such as auditing access to files or even just auditing the interactions between AI and humans.
Access to Microsoft 365 content through Graph API-based apps is not seamless. For example, the apps (which used to be called connectors) cannot deal with content encrypted and protected by sensitivity labels. It would be technically possible to use a Graph API to remove a sensitivity label from SharePoint Online and OneDrive for Business files, if the signed-in user has the rights to do so, to allow the app to access the unprotected content. The problem occurs when replacing the sensitivity label (which I assume is desirable) because the assignSensitivityLabel Graph API to assign labels to files is a metered API that’s paid for using an Azure subscription.
Not Functionally Equivalent
Being able to load files, emails, meetings, and chats into ChatGPT enterprise is emphatically not functionally equivalent to Microsoft 365 Copilot. The ChatGPT apps are an answer for Microsoft 365 tenants that don’t want to buy Copilot but do want to take advantage of AI processing.
I believe that choosing ChatGPT Enterprise for this reason is a bad decision because it focuses exclusively on content processing and doesn’t take aspects like governance, auditing, selective blocks to sensitive content like Restricted Content Discovery and the DLP policy for Microsoft 365 Copilot. Essentially, organizations that choose to go down the ChatGPT route put the responsibility for handling sensitive and confidential material in the hands of individual users. Hope is nice to have, but it’s not the basis for a compliance and data governance policy.
Returning to the Graph APIs
Even though I think Microsoft could do better with the development of the Graph APIs, the fact that OpenAI has been able to create a set of highly functional Graph-based apps to extract information from Microsoft 365 locations testifies to the usefulness of the Graph. I don’t think Microsoft is deliberately slowing Graph development to stop OpenAI stealing any of its Work IQ thunder. That’s taking conspiracy theory a tad too far in my view.
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!
Odd behavior of unstack in Matlab2025b
Hello,
When calling the unstack function using @sum as the AggregationFunction for numerical values in 2025b, I’m getting the warning below and the empty groups get a zero (from summing into a 0-1 input)
Warning: When a group has no rows for a given value of the indicator variable, UNSTACK calls the supplied aggregation function with an input of size 0-by-1 instead of automatically filling the value.
Review the output to ensure desired result is obtained. This warning might be removed in a future release.
However the function documentation states the following:
Missing value of the appropriate data type, such as a NaN, NaT, missing string, or undefined categorical value.
Which is the behavior I used to get in previous Matlab versions (e.g. 2019b), would get NaNs from empty groups, and which I would have epxected to happend here since its what the documentation suggests.
Any thoughts on why this might be happening or if I can change the behavior so as to get NaNs instead of calling the aggregation function into a 0-1 input for the empty groups?Hello,
When calling the unstack function using @sum as the AggregationFunction for numerical values in 2025b, I’m getting the warning below and the empty groups get a zero (from summing into a 0-1 input)
Warning: When a group has no rows for a given value of the indicator variable, UNSTACK calls the supplied aggregation function with an input of size 0-by-1 instead of automatically filling the value.
Review the output to ensure desired result is obtained. This warning might be removed in a future release.
However the function documentation states the following:
Missing value of the appropriate data type, such as a NaN, NaT, missing string, or undefined categorical value.
Which is the behavior I used to get in previous Matlab versions (e.g. 2019b), would get NaNs from empty groups, and which I would have epxected to happend here since its what the documentation suggests.
Any thoughts on why this might be happening or if I can change the behavior so as to get NaNs instead of calling the aggregation function into a 0-1 input for the empty groups? Hello,
When calling the unstack function using @sum as the AggregationFunction for numerical values in 2025b, I’m getting the warning below and the empty groups get a zero (from summing into a 0-1 input)
Warning: When a group has no rows for a given value of the indicator variable, UNSTACK calls the supplied aggregation function with an input of size 0-by-1 instead of automatically filling the value.
Review the output to ensure desired result is obtained. This warning might be removed in a future release.
However the function documentation states the following:
Missing value of the appropriate data type, such as a NaN, NaT, missing string, or undefined categorical value.
Which is the behavior I used to get in previous Matlab versions (e.g. 2019b), would get NaNs from empty groups, and which I would have epxected to happend here since its what the documentation suggests.
Any thoughts on why this might be happening or if I can change the behavior so as to get NaNs instead of calling the aggregation function into a 0-1 input for the empty groups? unstack, 2025b MATLAB Answers — New Questions
how to make a plot with three variables, one as a vector, in Matlab app designer?
Hi
I have some data, some arrays with name temperature, activity and then I have two arrrays named weight percent best_salt_1 and weight percent best_salt_2 that I will combine into a vector or to an array with one row and two columns for each set of values . And then I want to plot the data to visualise the information. But I dont have the newest version of Matlab , dont want to upgrade my version either. Hence I cant use the gscatter function that can make it possible to visualize all the info I want in my plot.
Then my question if whether I can use a trick like splitapply so everything I want to visualise here is possible..?Hi
I have some data, some arrays with name temperature, activity and then I have two arrrays named weight percent best_salt_1 and weight percent best_salt_2 that I will combine into a vector or to an array with one row and two columns for each set of values . And then I want to plot the data to visualise the information. But I dont have the newest version of Matlab , dont want to upgrade my version either. Hence I cant use the gscatter function that can make it possible to visualize all the info I want in my plot.
Then my question if whether I can use a trick like splitapply so everything I want to visualise here is possible..? Hi
I have some data, some arrays with name temperature, activity and then I have two arrrays named weight percent best_salt_1 and weight percent best_salt_2 that I will combine into a vector or to an array with one row and two columns for each set of values . And then I want to plot the data to visualise the information. But I dont have the newest version of Matlab , dont want to upgrade my version either. Hence I cant use the gscatter function that can make it possible to visualize all the info I want in my plot.
Then my question if whether I can use a trick like splitapply so everything I want to visualise here is possible..? plot, appdesigner, three variables, matlab 2018 MATLAB Answers — New Questions
Efficient overlapping block processing with nested sub blocks (similar to im2col with stride)
Hello, I recently have been doing a side project to teach myself some more efficient and performance optimized MATLAB and I ran into the following problem. My solution feels "ugly" to me and I highly suspect that there is a better version. I am intentionally straying from builtin functions like im2col and blockproc but I definitely am not asking you to restrict your solutions especially if they are high performance.
Problem:
An example of the input to the problem is generated by the following code. It consists of square matrix with nxn blocks. I use ascending integers to make it easier to keep track of the format of the data.
% example input matrix A with nxn blocks
n = 2;
N = 2*n^2;
A = kron((1:n^2).’,ones(1,2*N)) + (1:n^2:N^2) – 1;
[row,col] = ind2sub([n n],1:n^2);
A((row-1).*n+col,:) = A((col-1).*n+row,:);
A = col2im(A, [n n], [N N], ‘distinct’).’
The desired output from the input is to take a sliding block of 2n x 2n with a stride of n in both the x and y directions. This generates a block with 4 subblocks of size n x n. I would like to generate a similar result of im2col, but with the caveat that the column result keeps the individual sub blocks together (as if I had taken im2col of each of the sub blocks and then stacked them into a single column). Normally im2col scans the matrix top to bottom and left to right, but the final desired requirement is that the columns come from a sweep from left to right and then top to bottom.
My solution is:
% intermediate matrix B with 2n patches with n stride
M = length(A(:,1)) + n;
A(end+1:M,end+1:M) = 0;
[x,y] = meshgrid(1:2*n);
[xs,ys] = meshgrid(0:n:(M-2*n));
idx = (reshape(y,4*n^2,[]) + ys(:)’) + (M*reshape(x-1,4*n^2,[]) + M*xs(:)’);
colB = A(idx);
% these 2 lines not part of my solution but may help visualize the
% intermediate step of expanding the matrix
szB = sqrt(numel(colB));
B = col2im(colB, [2*n 2*n], [szB szB], ‘distinct’);
% reshape and permute chain for desired format and ordering
C = reshape(colB,n,2,[]);
C = permute(C,[1 3 2]);
C = reshape(C, 4*n^2, n, []);
C = permute(C, [1 3 2]);
C = reshape(C, 4*n^2,[]) % final desired output
The final result is good for general n and the solution runs decently fast. However it just looks like there is still performance to squeeze out of this. I feel like there is a more direct method than constructing the intermediate matrix and then decomposing it. I also feel like there is a better reordering process than my reshape->permute->reshape->permute->reshape. After too many hours trying I am forced to concede but hopefully someone here can teach me something new. Thanks in advance.Hello, I recently have been doing a side project to teach myself some more efficient and performance optimized MATLAB and I ran into the following problem. My solution feels "ugly" to me and I highly suspect that there is a better version. I am intentionally straying from builtin functions like im2col and blockproc but I definitely am not asking you to restrict your solutions especially if they are high performance.
Problem:
An example of the input to the problem is generated by the following code. It consists of square matrix with nxn blocks. I use ascending integers to make it easier to keep track of the format of the data.
% example input matrix A with nxn blocks
n = 2;
N = 2*n^2;
A = kron((1:n^2).’,ones(1,2*N)) + (1:n^2:N^2) – 1;
[row,col] = ind2sub([n n],1:n^2);
A((row-1).*n+col,:) = A((col-1).*n+row,:);
A = col2im(A, [n n], [N N], ‘distinct’).’
The desired output from the input is to take a sliding block of 2n x 2n with a stride of n in both the x and y directions. This generates a block with 4 subblocks of size n x n. I would like to generate a similar result of im2col, but with the caveat that the column result keeps the individual sub blocks together (as if I had taken im2col of each of the sub blocks and then stacked them into a single column). Normally im2col scans the matrix top to bottom and left to right, but the final desired requirement is that the columns come from a sweep from left to right and then top to bottom.
My solution is:
% intermediate matrix B with 2n patches with n stride
M = length(A(:,1)) + n;
A(end+1:M,end+1:M) = 0;
[x,y] = meshgrid(1:2*n);
[xs,ys] = meshgrid(0:n:(M-2*n));
idx = (reshape(y,4*n^2,[]) + ys(:)’) + (M*reshape(x-1,4*n^2,[]) + M*xs(:)’);
colB = A(idx);
% these 2 lines not part of my solution but may help visualize the
% intermediate step of expanding the matrix
szB = sqrt(numel(colB));
B = col2im(colB, [2*n 2*n], [szB szB], ‘distinct’);
% reshape and permute chain for desired format and ordering
C = reshape(colB,n,2,[]);
C = permute(C,[1 3 2]);
C = reshape(C, 4*n^2, n, []);
C = permute(C, [1 3 2]);
C = reshape(C, 4*n^2,[]) % final desired output
The final result is good for general n and the solution runs decently fast. However it just looks like there is still performance to squeeze out of this. I feel like there is a more direct method than constructing the intermediate matrix and then decomposing it. I also feel like there is a better reordering process than my reshape->permute->reshape->permute->reshape. After too many hours trying I am forced to concede but hopefully someone here can teach me something new. Thanks in advance. Hello, I recently have been doing a side project to teach myself some more efficient and performance optimized MATLAB and I ran into the following problem. My solution feels "ugly" to me and I highly suspect that there is a better version. I am intentionally straying from builtin functions like im2col and blockproc but I definitely am not asking you to restrict your solutions especially if they are high performance.
Problem:
An example of the input to the problem is generated by the following code. It consists of square matrix with nxn blocks. I use ascending integers to make it easier to keep track of the format of the data.
% example input matrix A with nxn blocks
n = 2;
N = 2*n^2;
A = kron((1:n^2).’,ones(1,2*N)) + (1:n^2:N^2) – 1;
[row,col] = ind2sub([n n],1:n^2);
A((row-1).*n+col,:) = A((col-1).*n+row,:);
A = col2im(A, [n n], [N N], ‘distinct’).’
The desired output from the input is to take a sliding block of 2n x 2n with a stride of n in both the x and y directions. This generates a block with 4 subblocks of size n x n. I would like to generate a similar result of im2col, but with the caveat that the column result keeps the individual sub blocks together (as if I had taken im2col of each of the sub blocks and then stacked them into a single column). Normally im2col scans the matrix top to bottom and left to right, but the final desired requirement is that the columns come from a sweep from left to right and then top to bottom.
My solution is:
% intermediate matrix B with 2n patches with n stride
M = length(A(:,1)) + n;
A(end+1:M,end+1:M) = 0;
[x,y] = meshgrid(1:2*n);
[xs,ys] = meshgrid(0:n:(M-2*n));
idx = (reshape(y,4*n^2,[]) + ys(:)’) + (M*reshape(x-1,4*n^2,[]) + M*xs(:)’);
colB = A(idx);
% these 2 lines not part of my solution but may help visualize the
% intermediate step of expanding the matrix
szB = sqrt(numel(colB));
B = col2im(colB, [2*n 2*n], [szB szB], ‘distinct’);
% reshape and permute chain for desired format and ordering
C = reshape(colB,n,2,[]);
C = permute(C,[1 3 2]);
C = reshape(C, 4*n^2, n, []);
C = permute(C, [1 3 2]);
C = reshape(C, 4*n^2,[]) % final desired output
The final result is good for general n and the solution runs decently fast. However it just looks like there is still performance to squeeze out of this. I feel like there is a more direct method than constructing the intermediate matrix and then decomposing it. I also feel like there is a better reordering process than my reshape->permute->reshape->permute->reshape. After too many hours trying I am forced to concede but hopefully someone here can teach me something new. Thanks in advance. reshaping, im2col, block processing MATLAB Answers — New Questions
Simulink Playback Block Dropping Ports
When I save a model and close it, the next time I open it my playback block outputs say ground and I have to go manually reconnect them to the data in the workspace.
This seems to be a new issue in 2024b as we’ve used Playback blocks for years without issue.
The blocks work fine as long as the model is open, but when I close it, there is a good chance the Playback block loses it’s outputs. It doesn’t happen every time, but it’s > 1 out of 3.When I save a model and close it, the next time I open it my playback block outputs say ground and I have to go manually reconnect them to the data in the workspace.
This seems to be a new issue in 2024b as we’ve used Playback blocks for years without issue.
The blocks work fine as long as the model is open, but when I close it, there is a good chance the Playback block loses it’s outputs. It doesn’t happen every time, but it’s > 1 out of 3. When I save a model and close it, the next time I open it my playback block outputs say ground and I have to go manually reconnect them to the data in the workspace.
This seems to be a new issue in 2024b as we’ve used Playback blocks for years without issue.
The blocks work fine as long as the model is open, but when I close it, there is a good chance the Playback block loses it’s outputs. It doesn’t happen every time, but it’s > 1 out of 3. simulink, playback block MATLAB Answers — New Questions
Low-Key Debut for Entra ID Backup and Recovery
Microsoft Launches Preview of Entra ID Backup and Recovery
It’s hard to know what to make of the preview of the Entra ID Backup and Recovery feature that is available to tenants through the Entra admin center (Figure 1). The preview feature showed up on 19 March 2026.

Access to data in the Entra ID Backup and Recovery section of the Entra admin center requires at least the (new) Entra Backup Reader administrative role.
A Very Quiet Preview
Despite lots of chatter about the new feature in the technical community, Microsoft say anything until late on March 20 when a brief reference to Entra ID Backup and Recovery was included in a set of announcements for this week’s RSA conference (the formal name is Microsoft Entra Backup and Recovery). The documentation linked to in the Entra admin center is for Microsoft 365 Backup for SharePoint Online and Exchange Online. In addition, a notification has not yet appeared in the Microsoft 365 message center. For such an important capability, Microsoft is being very quiet.
The product documentation says that Backup and Recovery is available to tenants with Entra P1 or P2 licenses. Some have reported that they have the feature without these licenses.
What We Know About Entra ID Backup and Recovery
Equipped with the documentation and a day or so of hands-on experience, here’s what we can say about the highlights of Entra ID Backup and Recovery.
Backups are taken once daily (in the case of my tenant, at 10pm nightly). The preview does not give tenants the chance to vary the time, nor can you disable backups. Everything happens automatically. According to the admin center, backups cover “core tenant objects” such as “users, groups, applications, conditional access policies, service principals, organization, authentication methods, authorization policy, and named locations.” In other words, the core directory objects.
Entra ID isn’t like other workloads like Exchange Online or SharePoint Online where the need for backup spans both objects and data (email, folders, files, etc.). Noting changes made to core directory objects and being able to restore to a point in time doesn’t require the same amount of storage.
Entra ID keeps five backups on a rolling basis. In other words, the maximum recovery period is five days. You can’t change how long backups remain valid for. At least, not in the preview (I’m sure some tenants will look for at least ten days).
Difference reports can be generated to highlight the differences between the current state of object properties and the values from a selected backup. The idea is to use the difference reports to decide which backup to recover from. When requested, background jobs generate the reports. Report generation can take a long time. My small tenant requires at least 75 minutes. Reducing the time required for report generation is the kind of improvement made for general availability, and because a difference report is an important source of information for a recovery operation, it makes sense to reduce the time needed to create the report.
Figure 2 shows the kind of information you can expect to see in a difference report. Remember, the items in the report represent changes between the current state and the selected backup. The first item is for the creation of an enterprise app (service principal) and we’re told that the recovery action will be to soft-delete the app (just in case, recovery never hard deletes objects). The second item is also for a service principal, but in this instance, it reports the assignment of a delegated OAuth2 permission, so the recovery action is to update the service principal to remove the permission. At the end of the list are entries for dynamic groups where Entra ID has updated the group memberships by adding links to objects.

Interestingly, objects that are hard-deleted (permanently removed) from Entra ID cannot be recovered. Microsoft suggests that tenants use protected actions to stop unexpected hard deletions.
One thing I miss is the ability to export a difference report for analysis. Nice as it is to see a list of differences on screen, a busy tenant can easily generate thousands of changes daily, and going through each item on screen is no fun. Being able to extract the report items and feed the data to AI for analysis (or doing the job manually) would be better.
Recovery is done by selecting a valid backup and choosing the Recover backup option, or by using the Recover option when viewing a difference report. A user must hold the (new) Entra Backup Administrator role to initiate a recovery. Filters allow recovery by object type (for example, user accounts), specific object identifier, or all changes. After selecting the type of recovery to perform (Figure 3), Entra starts a background job to recover the objects.

Recovery means that the Entra ID objects selected from the backup are recovered to the point in time for the backup. As Microsoft notes, recovery performance depends on how many changes Entra ID must process. Apparently, processing 500,000 changes can take up to 30 hours! Everything worked in the tests that I did, which is exactly what you want from a Backup and Recovery solution.
The Recovery History section lists recovery jobs, including the number of affected objects. However, no further details are available. This seems like an area that could be improved by making a list of the recovered objects easily accessible to administrators.
Building an Entra Recovery Story
Microsoft deserves commendation for providing a state-based backup and recovery solution for Entra ID at the tenant level. The new capability builds on the object-level recovery from deletion for users, groups, service principals, administrative units, applications, and conditional access policies. Recovery from deletion is accomplished by putting objects into a soft-deleted state and holding them in a recycle bin from where the objects can be recovered for up to 30 days following deletion. The two mechanisms mitigate the effects of accidental or deliberate (malicious) deletions.
Devices are due to support soft deletion, but the capability hasn’t yet been delivered (the Microsoft Graph PowerShell SDK includes a Get-MgDirectoryDeletedItemAsDevice cmdlet that calls the https://graph.microsoft.com/beta/directory/deletedItems/microsoft.graph.device endpoint, but no results are returned). See this article for details about how to create a report of soft-deleted Entra ID objects.
An Interesting Development
There’s no doubt that the advent of Entra ID Backup and Recovery is interesting for both tenants and ISVs who are active in the backup space. Tenants will be delighted to get a native backup and recovery feature while ISVs will pick the new feature apart to discover advantages and disadvantages for their products. Entra ID Backup and Recovery sets a new (entry-level) bar for backup products. As such, it’s a topic that deserves attention from tenant administrators.
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.
import Robot from URDF file
In the ‘PickandPlaceWorkflowInUnity3DUsingROSExample’,I have some problem at importing Robot from URDF file,the model cann’t be fully imported in the unity.In the ‘PickandPlaceWorkflowInUnity3DUsingROSExample’,I have some problem at importing Robot from URDF file,the model cann’t be fully imported in the unity. In the ‘PickandPlaceWorkflowInUnity3DUsingROSExample’,I have some problem at importing Robot from URDF file,the model cann’t be fully imported in the unity. unity, matlab MATLAB Answers — New Questions
SNR goes down as noise filtering is increased.
Hello friends. I have a question regarding filtering noise from noisy signals. I filtered a signal (data attached to this post) using Wiener2 with a window size of 3 and 11. I then subtracted the filtered signal from the orginal signal to get noise. Surprisingly, the SNR for the more filtered signal (corresponding to window size of 11) is lesser than the least filtered. Could this be due to the signal getting attenuated along with the noise ? Any direction to this issue will be much appreciated. The code is also attached. Thank you.
%% SNR comparision befrore and after filtering noise
%noisydata = readmatrix("Data_response_thickJn_1W_IPA_set1_5.csv");
load ("noisyData.mat")
noisydata = data;
time = noisydata(:,1);
temp = noisydata(:,2);
% filtering using Wiener filter
filteredTemp1 = wiener2(temp,[3,1]); %low filter window
noise1 = temp – filteredTemp1;
SNR1 = snr(temp,noise1)
filteredTemp2 = wiener2(temp,[11,1]); %high filter window
noise2 = temp – filteredTemp2;
SNR2 = snr(temp,noise2)Hello friends. I have a question regarding filtering noise from noisy signals. I filtered a signal (data attached to this post) using Wiener2 with a window size of 3 and 11. I then subtracted the filtered signal from the orginal signal to get noise. Surprisingly, the SNR for the more filtered signal (corresponding to window size of 11) is lesser than the least filtered. Could this be due to the signal getting attenuated along with the noise ? Any direction to this issue will be much appreciated. The code is also attached. Thank you.
%% SNR comparision befrore and after filtering noise
%noisydata = readmatrix("Data_response_thickJn_1W_IPA_set1_5.csv");
load ("noisyData.mat")
noisydata = data;
time = noisydata(:,1);
temp = noisydata(:,2);
% filtering using Wiener filter
filteredTemp1 = wiener2(temp,[3,1]); %low filter window
noise1 = temp – filteredTemp1;
SNR1 = snr(temp,noise1)
filteredTemp2 = wiener2(temp,[11,1]); %high filter window
noise2 = temp – filteredTemp2;
SNR2 = snr(temp,noise2) Hello friends. I have a question regarding filtering noise from noisy signals. I filtered a signal (data attached to this post) using Wiener2 with a window size of 3 and 11. I then subtracted the filtered signal from the orginal signal to get noise. Surprisingly, the SNR for the more filtered signal (corresponding to window size of 11) is lesser than the least filtered. Could this be due to the signal getting attenuated along with the noise ? Any direction to this issue will be much appreciated. The code is also attached. Thank you.
%% SNR comparision befrore and after filtering noise
%noisydata = readmatrix("Data_response_thickJn_1W_IPA_set1_5.csv");
load ("noisyData.mat")
noisydata = data;
time = noisydata(:,1);
temp = noisydata(:,2);
% filtering using Wiener filter
filteredTemp1 = wiener2(temp,[3,1]); %low filter window
noise1 = temp – filteredTemp1;
SNR1 = snr(temp,noise1)
filteredTemp2 = wiener2(temp,[11,1]); %high filter window
noise2 = temp – filteredTemp2;
SNR2 = snr(temp,noise2) digital signal processing, noise, filtering MATLAB Answers — New Questions
Direct Dynamics of Two-Link Manipulator
Hi,
I am unsuccesful in using a MATLAB function block in Simulink to model the direct dynamics of a two-link planar manipulator. The function takes the gear ratio (), 2×1 motor torque (), angular position ($v$) and angular velocity ($dot v$) and outputs the angular acceleration ($ddot v$). See below for my Simulink model.The torque step function has a step time of 0.1, initial value of [0;0]. final value of [15;10] and also a sample time of 0.1. = 10 is a constant. The first integrator has initial conditions [-pi/2,0] and the second has initial conditions of [0,0]. I am outputting the torque, joint velocity and the joint position to the workspace.
I am getting the correct vector for torque: $[tao_1, tao_2] = [0,0]$ at time 0 and $[tao_1, tao_2] = [15,10]$ after that. However the joint 1 position is decreasing from 0 to -15 and the joint 2 position is staying at 0. The joint 1 and 2 velocities are staying constant at the initial velocity of -pi/2,0. I have pasted my code that I have gone over numerous times so I doubt there is any issue there. I think the issue is more in the setup for the Simulink.
Was wondering if people can help pinpoint the problem and help lead me in the right direction.
function v_ddot = dynamics(n, t_m, v_dot, v)
%given constants
ml1 = 49; ml2 = 34;
a1 = 1; a2 = 1;
l1 = 0.5; l2 = 0.5;
Iyy_1 = 4.08; Iyy_2 = 2.83;
Im1 = 0.25; Im2 = 0.25;
b1 = 12; b2 = 12;
bm1 = 0.08; bm2 = 0.08;
g = 9.8;
%calculations for lumped parameters I1 and I2
I1 = Iyy_1 + ml1 * l1^2 + ml2 * a1^2;
I2 = Iyy_2 + ml2 * l2^2;
h = ml2*a1*l2;
%mass, centrifugal/coriolis, gravitational, friction vectors
M = [n^2*Im1 + I1 + I2 + 2*h*cos(v(2)), I2 + h*cos(v(2)); I2 + h*cos(v(2)), n^2*Im2 + I2];
V = h*sin(v(2))*[-2*v_dot(1)*v_dot(2) – v_dot(2)^2; v_dot(1)^2];
G = [(ml1*l1 + ml2*l2)*cos(v(1))*g + ml2*l2*cos(v(1)+v(2))*g; ml2*l2*cos(v(1)+v(2))*g];
F = [b1*v_dot(1) + n^2*bm1; b2*v_dot(2) + n^2*bm2*v_dot(2)];
%solving for the angualar accelerations
v_ddot = M (-V – G – F + t_m * n);
endHi,
I am unsuccesful in using a MATLAB function block in Simulink to model the direct dynamics of a two-link planar manipulator. The function takes the gear ratio (), 2×1 motor torque (), angular position ($v$) and angular velocity ($dot v$) and outputs the angular acceleration ($ddot v$). See below for my Simulink model.The torque step function has a step time of 0.1, initial value of [0;0]. final value of [15;10] and also a sample time of 0.1. = 10 is a constant. The first integrator has initial conditions [-pi/2,0] and the second has initial conditions of [0,0]. I am outputting the torque, joint velocity and the joint position to the workspace.
I am getting the correct vector for torque: $[tao_1, tao_2] = [0,0]$ at time 0 and $[tao_1, tao_2] = [15,10]$ after that. However the joint 1 position is decreasing from 0 to -15 and the joint 2 position is staying at 0. The joint 1 and 2 velocities are staying constant at the initial velocity of -pi/2,0. I have pasted my code that I have gone over numerous times so I doubt there is any issue there. I think the issue is more in the setup for the Simulink.
Was wondering if people can help pinpoint the problem and help lead me in the right direction.
function v_ddot = dynamics(n, t_m, v_dot, v)
%given constants
ml1 = 49; ml2 = 34;
a1 = 1; a2 = 1;
l1 = 0.5; l2 = 0.5;
Iyy_1 = 4.08; Iyy_2 = 2.83;
Im1 = 0.25; Im2 = 0.25;
b1 = 12; b2 = 12;
bm1 = 0.08; bm2 = 0.08;
g = 9.8;
%calculations for lumped parameters I1 and I2
I1 = Iyy_1 + ml1 * l1^2 + ml2 * a1^2;
I2 = Iyy_2 + ml2 * l2^2;
h = ml2*a1*l2;
%mass, centrifugal/coriolis, gravitational, friction vectors
M = [n^2*Im1 + I1 + I2 + 2*h*cos(v(2)), I2 + h*cos(v(2)); I2 + h*cos(v(2)), n^2*Im2 + I2];
V = h*sin(v(2))*[-2*v_dot(1)*v_dot(2) – v_dot(2)^2; v_dot(1)^2];
G = [(ml1*l1 + ml2*l2)*cos(v(1))*g + ml2*l2*cos(v(1)+v(2))*g; ml2*l2*cos(v(1)+v(2))*g];
F = [b1*v_dot(1) + n^2*bm1; b2*v_dot(2) + n^2*bm2*v_dot(2)];
%solving for the angualar accelerations
v_ddot = M (-V – G – F + t_m * n);
end Hi,
I am unsuccesful in using a MATLAB function block in Simulink to model the direct dynamics of a two-link planar manipulator. The function takes the gear ratio (), 2×1 motor torque (), angular position ($v$) and angular velocity ($dot v$) and outputs the angular acceleration ($ddot v$). See below for my Simulink model.The torque step function has a step time of 0.1, initial value of [0;0]. final value of [15;10] and also a sample time of 0.1. = 10 is a constant. The first integrator has initial conditions [-pi/2,0] and the second has initial conditions of [0,0]. I am outputting the torque, joint velocity and the joint position to the workspace.
I am getting the correct vector for torque: $[tao_1, tao_2] = [0,0]$ at time 0 and $[tao_1, tao_2] = [15,10]$ after that. However the joint 1 position is decreasing from 0 to -15 and the joint 2 position is staying at 0. The joint 1 and 2 velocities are staying constant at the initial velocity of -pi/2,0. I have pasted my code that I have gone over numerous times so I doubt there is any issue there. I think the issue is more in the setup for the Simulink.
Was wondering if people can help pinpoint the problem and help lead me in the right direction.
function v_ddot = dynamics(n, t_m, v_dot, v)
%given constants
ml1 = 49; ml2 = 34;
a1 = 1; a2 = 1;
l1 = 0.5; l2 = 0.5;
Iyy_1 = 4.08; Iyy_2 = 2.83;
Im1 = 0.25; Im2 = 0.25;
b1 = 12; b2 = 12;
bm1 = 0.08; bm2 = 0.08;
g = 9.8;
%calculations for lumped parameters I1 and I2
I1 = Iyy_1 + ml1 * l1^2 + ml2 * a1^2;
I2 = Iyy_2 + ml2 * l2^2;
h = ml2*a1*l2;
%mass, centrifugal/coriolis, gravitational, friction vectors
M = [n^2*Im1 + I1 + I2 + 2*h*cos(v(2)), I2 + h*cos(v(2)); I2 + h*cos(v(2)), n^2*Im2 + I2];
V = h*sin(v(2))*[-2*v_dot(1)*v_dot(2) – v_dot(2)^2; v_dot(1)^2];
G = [(ml1*l1 + ml2*l2)*cos(v(1))*g + ml2*l2*cos(v(1)+v(2))*g; ml2*l2*cos(v(1)+v(2))*g];
F = [b1*v_dot(1) + n^2*bm1; b2*v_dot(2) + n^2*bm2*v_dot(2)];
%solving for the angualar accelerations
v_ddot = M (-V – G – F + t_m * n);
end simulink MATLAB Answers — New Questions









