Category: News
Polyspace Code Prover incremental/delta analysis
Hi,
is there an option to run Polyspace Code Prover only for changes since the last baseline/commit (basically for files that only changed since the last baseline/commit) ?
This would be crucial to decrease analysis time.
The only adjusting screws for analysis time I know are precision level (-O0, -O1 etc.), verification level (pass0, pass1 etc.) and CPU core count (max-processes option).
We set up PSCP for now locally but the goal is to run it in the CI pipeline and shorter pipeline runs are of course preferred.Hi,
is there an option to run Polyspace Code Prover only for changes since the last baseline/commit (basically for files that only changed since the last baseline/commit) ?
This would be crucial to decrease analysis time.
The only adjusting screws for analysis time I know are precision level (-O0, -O1 etc.), verification level (pass0, pass1 etc.) and CPU core count (max-processes option).
We set up PSCP for now locally but the goal is to run it in the CI pipeline and shorter pipeline runs are of course preferred. Hi,
is there an option to run Polyspace Code Prover only for changes since the last baseline/commit (basically for files that only changed since the last baseline/commit) ?
This would be crucial to decrease analysis time.
The only adjusting screws for analysis time I know are precision level (-O0, -O1 etc.), verification level (pass0, pass1 etc.) and CPU core count (max-processes option).
We set up PSCP for now locally but the goal is to run it in the CI pipeline and shorter pipeline runs are of course preferred. polyspace, polyspace code prover, incremental MATLAB Answers — New Questions
Why do I receive the error “Something went wrong preparing your license for use.”?
1) When accessing MATLAB Online after signing in through my Campus portal page, I receive a message stating "Something went wrong preparing your license for use." If I try to access MATLAB Online directly through matlab.mathworks.com, the message I receive is, "Your MathWorks account is not linked to an active license."
2) When starting a 30 day trial for MATLAB, I receive an error message stating "Something went wrong preparing your license for use".1) When accessing MATLAB Online after signing in through my Campus portal page, I receive a message stating "Something went wrong preparing your license for use." If I try to access MATLAB Online directly through matlab.mathworks.com, the message I receive is, "Your MathWorks account is not linked to an active license."
2) When starting a 30 day trial for MATLAB, I receive an error message stating "Something went wrong preparing your license for use". 1) When accessing MATLAB Online after signing in through my Campus portal page, I receive a message stating "Something went wrong preparing your license for use." If I try to access MATLAB Online directly through matlab.mathworks.com, the message I receive is, "Your MathWorks account is not linked to an active license."
2) When starting a 30 day trial for MATLAB, I receive an error message stating "Something went wrong preparing your license for use". MATLAB Answers — New Questions
Why does an error message appear when clicking a requirement link created using “Link to Selected Requirement” in Test Manager?
I see an error message when I click a requirement link created using "Link to Selected Requirement" in Test Manager.
Error "File not found: ./requirement/z.slreqx (channel: "Test/OpenReqLink")"I see an error message when I click a requirement link created using "Link to Selected Requirement" in Test Manager.
Error "File not found: ./requirement/z.slreqx (channel: "Test/OpenReqLink")" I see an error message when I click a requirement link created using "Link to Selected Requirement" in Test Manager.
Error "File not found: ./requirement/z.slreqx (channel: "Test/OpenReqLink")" to, "test, manager", "how, use" MATLAB Answers — New Questions
Tenable Vulnerability CVS-2026-34480
Is MATLAB R2024a vulnerable to CVE-2026-34480, and is there a security advisory or patch available? The Tenable scanner in our air gapped environment flags this finding as a High vulnerability, so we need to either patch or have something from the vendor we can present to our cybersecurity team. At this time, we cannot upgrade our Matlab version so if there is no patch, we will need to POAM. Thanks!Is MATLAB R2024a vulnerable to CVE-2026-34480, and is there a security advisory or patch available? The Tenable scanner in our air gapped environment flags this finding as a High vulnerability, so we need to either patch or have something from the vendor we can present to our cybersecurity team. At this time, we cannot upgrade our Matlab version so if there is no patch, we will need to POAM. Thanks! Is MATLAB R2024a vulnerable to CVE-2026-34480, and is there a security advisory or patch available? The Tenable scanner in our air gapped environment flags this finding as a High vulnerability, so we need to either patch or have something from the vendor we can present to our cybersecurity team. At this time, we cannot upgrade our Matlab version so if there is no patch, we will need to POAM. Thanks! cvs-2026-34480 MATLAB Answers — New Questions
Microsoft Blocks Graph Access to Non-IPM Folders
Clamping Down on Access to Non-IPM Folders Stops App from Fetching Copilot Interactions
In November 2024, I published an article explaining how to use the Microsoft Graph PowerShell SDK to analyze the compliance records for Microsoft 365 Copilot prompts and responses. The compliance records are stored in a non-IPM folder called TeamsMessagesData, along with the compliance records for Teams chats. A non-IPM folder is one of the hidden folders that exists in user mailboxes which isn’t accessible through “regular” clients like Outlook. Specialized utilities like MFCMAPI can access non-IPM folders.
Last month, I tried to run the code for the first time in a couple of months only to find that the Get-MgUserMailFolderMessage cmdlet returns an error. Here’s some same code to illustrate the issue. TeamsMessagesData is a well-known folder like the Inbox or Deleted Items folders, so you can pass the name rather than a folder identifier:
$UserId = (Get-MgContext).User
[array]$Items = Get-MgUserMailFolderMessage -UserId $User.Id -MailFolderId 'TeamsMessagesData' -All -PageSize 500
Get-MgUserMailFolderMessage_List:
Line |
2 | [array]$Items = Get-MgUserMailFolderMessage -UserId $User.Id -MailFol …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Not allowed to access Non IPM folder.
Status: 403 (Forbidden)
ErrorCode: ErrorAccessDenied
I knew that Microsoft had restricted the ability to use Exchange Web Services to access the TeamsMessagesData folder (a decision that delighted many backup vendors who used EWS to copy Teams compliance records) but hadn’t seen anything similar relating to the Graph APIs.
Not Much Can be Done
There’s no way around the block. The Graph intercepts every attempt to retrieve items from the TeamsMessagesData folder and responds with the 403 error. Microsoft uses different APIs to access the folder when the Microsoft 365 substrate creates compliance records and Purview solutions like eDiscovery and Communication compliance read the compliance records.
I can’t think of any damage that could be done by reading details of Copilot compliance records to discover what the records contain, but obviously someone in Microsoft decided to stop Graph-based applications from being able to read items in non-IPM folders.
I guess I shouldn’t have been surprised. Ever since the Midnight Blizzard attack in 2024 exposes flaws in Microsoft 365 infrastructure and protocols, Microsoft has been steadily finding and closing off holes and potential weaknesses, no matter how small. Another example relating to mail items is the change to limit app access to sensitive message properties, which is due to kick in at the end of 2026.
The aiInteractionHistory Alternative
Instead of reading compliance records, we can use the Graph aiInteractionHistory API. The API works, and the only problem is to figure out what the interaction records contain. It’s the same kind of game that we play when interpretingthe audit data payload for Purview audit records.
I updated the script for the last article to use the production version of the current aiInteractionHistory API. The script can be downloaded from the Office 365 for IT Pros GitHub repository. It fetches the Copilot interactions for the last month for a user and reports the number for each app and does some elementary calculations:
Copilot interactions for Tony Redmond between 04-May-2026 and 04-Jun-2026 Name Count ---- ----- Microsoft 365 Chat 544 Tony Redmond 346 Copilot in Word 128 Copilot in SharePoint 18 Microsoft Copilot 16 Copilot in OfficeCopilotSearchAnswer 14 Copilot in Teams 4 Outlook 1 128 of the 1071 interactions are automatic (11.95%) 346 of the interactions are user prompts (32.31%)
One thing that I noticed is that the body of AI responses is often a value like <attachment id=”f0150a5983e94abcb9b079ffc322697b”></attachment> (Figure 1). The body is a pointer to an internal file containing the formatted body of the AI response.

When you dig into the data, the identifier in the body is a pointer to a value held in the Attachments property of the interaction record. This is where we find the real text of Copilot’s response in a kind of Markdown format with some HTML thrown into the mix. To extract clean text from the response, we need to do something like this (where $Record holds a Copilot interaction returned by the aiInteractionHistory API):
Add-Type -AssemblyName System.Web $OriginalText = $record.attachments[0].content | ConvertFrom-json $CleanText = [System.Web.HttpUtility]::HtmlDecode($OriginalText.body.text)
There’s a bunch of other conditions to deal with for interactions capturing the automatic summaries for Word documents and other automatic responses. I’ve dealt with the conditions I came across in the script code but cannot pretend that other conditions might arise that code changes are needed to handle. For now, the code works and generates what I need (Figure 2):

No Way Round So We Miss Some Data
The aiInteractionHistory API gives access to Copilot interaction data and is a good replacement for Graph access to compliance records, providing you do the work to extract all the information from the records returned by the API and you’re only interested in tracking interactions for people with Microsoft 365 Copilot licenses. The compliance records captured for users also include Microsoft Copilot interactions (the free version). Not being able to report those interactions is a reduction in functionality.
Fortunately, eDiscovery searches for Copilot content finds both Microsoft 365 Copilot and Microsoft Copilot interactions. In addition, investigators want to see exactly how Copilot responded to a user prompt can view transcripts of Copilot interactions that include all the prompts and responses.
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.
List all memoized function caches
I know that clearAllMemoizedCaches will clear all memoized function data, but what if I just want to list all existing memoized caches (and maybe also their cache stats). Is there a way to do that?I know that clearAllMemoizedCaches will clear all memoized function data, but what if I just want to list all existing memoized caches (and maybe also their cache stats). Is there a way to do that? I know that clearAllMemoizedCaches will clear all memoized function data, but what if I just want to list all existing memoized caches (and maybe also their cache stats). Is there a way to do that? memoize MATLAB Answers — New Questions
Make memoized function calls independent of Name/Value argument ordering
In the demo below, we see that the memoized function func() executes twice out of the three times it is called. Ideally, it would only execute upon the first call, but the memoization engine fails to recognize that (1) and (2) are equivalent calls. Is there any way to get a memoized function to ignore differences in the ordering of Name/Value arguments?
mf=memoize(@func);
mf(‘A’,1,’B’,2) %(1) Cached
mf(‘B’,2,’A’,1) %(2) Cached
mf(‘A’,1,’B’,2) %(3) Not Cached
function func(opts)
arguments
opts.A
opts.B
end
disp("Executing")
endIn the demo below, we see that the memoized function func() executes twice out of the three times it is called. Ideally, it would only execute upon the first call, but the memoization engine fails to recognize that (1) and (2) are equivalent calls. Is there any way to get a memoized function to ignore differences in the ordering of Name/Value arguments?
mf=memoize(@func);
mf(‘A’,1,’B’,2) %(1) Cached
mf(‘B’,2,’A’,1) %(2) Cached
mf(‘A’,1,’B’,2) %(3) Not Cached
function func(opts)
arguments
opts.A
opts.B
end
disp("Executing")
end In the demo below, we see that the memoized function func() executes twice out of the three times it is called. Ideally, it would only execute upon the first call, but the memoization engine fails to recognize that (1) and (2) are equivalent calls. Is there any way to get a memoized function to ignore differences in the ordering of Name/Value arguments?
mf=memoize(@func);
mf(‘A’,1,’B’,2) %(1) Cached
mf(‘B’,2,’A’,1) %(2) Cached
mf(‘A’,1,’B’,2) %(3) Not Cached
function func(opts)
arguments
opts.A
opts.B
end
disp("Executing")
end memoize, name/value MATLAB Answers — New Questions
What’s the Best Way to Convert a .mat File from -v4 format to -v7 Format?
Is there a better way than reading all of the data from the -v4 .mat file and then saving all of the data to a -v7?
data = load(‘v4matfile.mat’);
save("v7matfile.mat","-struct","data","-v7");Is there a better way than reading all of the data from the -v4 .mat file and then saving all of the data to a -v7?
data = load(‘v4matfile.mat’);
save("v7matfile.mat","-struct","data","-v7"); Is there a better way than reading all of the data from the -v4 .mat file and then saving all of the data to a -v7?
data = load(‘v4matfile.mat’);
save("v7matfile.mat","-struct","data","-v7"); save, -v4, -v7 MATLAB Answers — New Questions
Microsoft Tightens Security for Self-Service Password Reset
SSPR Will Require Authentication Methods for Password Resets
Message center notification MC1325414 deserves the attention of any Microsoft 365 tenant that uses the Entra ID Self-Service Password Reset (SSPR) facility to allow users to change their password without assistance.
When someone uses SSPR to changes their password, Entra ID requires them to verify their identity. Currently, while SSPR prefers using authenticated methods to verify identities, it can fall back and use contact information stored in Entra ID such as mobile phone numbers or alternative email addresses for verification. The issue is that directory attributes are easily updated, which exposes the possibility that a malicious actor might be able to update a phone number or email address and be then able to change a user’s password and gain access to their account.
To solve the problem, Microsoft will require explicitly registered authentication methods to verify user identities. In other words, a user must go to their Security Info page to register one of the sign-in (authentication) methods configured in the tenant (Figure 1). After successfully adding the selected authentication method to their account, the method can be used to verify the user’s identity when they change their password.

Microsoft says that a user-validated method is safer than validating accounts based on directory attributes, and they’re right. The change aligns SSPR verification with the same authentication methods used for sign-in, and that’s a good thing.
Date Line for Deployment
The changeover will follow a two-phase approach:
- July 6, 2026: Microsoft will initiate an SSPR registration campaign to prompt users and administrators who have not registered an authentication method to go ahead and do so.
- September 6, 2026: SSPR enforces the requirement that password changes are only possible for accounts that have registered an authentication method. Users who have not registered an authentication method will be unable to change their password and will be directed to contact an administrator (or help desk) for assistance.
In MC1325414, Microsoft says that approximately 86% of SSPR verifications use registered authentication methods. That’s certainly a good base to work off, but 14% of the Microsoft 365 user population is 67.5 million accounts (based on 450 million Microsoft 365 paid seats). Not everyone uses SSPR, but the sheer size of Microsoft 365 indicates that there’s some work to be done.
Finding the User Accounts Who Need to Act
To discover the set of SSPR-enabled accounts that haven’t yet registered an authentication method, run the Get-MgReportAuthenticationMethodUserRegistrationDetail cmdlet from the Microsoft Graph PowerShell SDK (requires the AuditLog.Read.All permission). The cmdlet works with summary information extracted from Entra ID, and while the information is not up to date, it is good enough to work from. The data is the same as seen by going to the Authentication methods section of the Entra admin center and viewing User registration details.
This command runs the cmdlet with a filter to find user accounts that are SSPR enabled but haven’t got at least one registered authentication method:
Get-MgReportAuthenticationMethodUserRegistrationDetail -All -Filter "isSsprEnabled eq true and IsSsprRegistered eq false" | Format-Table UserPrincipalName, IsSsprEnabled, IsSsprRegistered -AutoSize UserPrincipalName IsSsprEnabled IsSsprRegistered ----------------- ------------- ---------------- Brian.Weakliam@office365itpros.com True False Chris.Bishop@office365itpros.com True False Hans.Geering@office365itpros.com True False James.Ryan@office365itpros.com True False Lotte.Vetler@office365itpros.com True False Otto.Flick@office365itpros.com True False
What should you do if some accounts are listed as needing to register an authentication method? As mentioned above, Microsoft will initiate a registration campaign on July 6 to encourage users to sign up for their preferred authentication method. If July 6 seems too far away and you think that vacation is likely to occupy peoples’ thoughts at that time, maybe you could launch your own registration campaign sooner. Or just start to send people email to ask them to do the right thing.
Remember Those Who Can’t Respond
It’s the nature of all things IT that some users will be unable to respond to calls and campaigns and won’t register an authentication method before the September 6 deadline. A weekly check against the accounts identified by the Get-MgReportAuthenticationMethodUserRegistrationDetail cmdlet is probably enough to keep an eye on the campaign and make sure that users are registering at the needed rate.
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.
Achieving success with AI
The two most important elements in any AI solution are Intelligence + Trust. I first made this statement in November at our Ignite conference and my conviction is strengthened by every conversation I have with customers. Through my travels, three consistent topics are being raised when considering the adoption of AI solutions:
- Will AI amplify the intelligence of my organization and the attributes that make my company unique within its industry to grow my business; or will it use my intelligence for its own benefit, learning from my most important business flows and leveraging my intellectual property?
- Can I trust that the outcomes are providing durable return on investment and that these solutions are running within the confines of my governance and security standards?
- How do I get the visibility, control, flexibility and business model innovation needed to manage the costs associated with AI and maximize value?
I consistently advise customers that they need to build their own IQ on a platform of intelligence that is model-diverse, open and heterogeneous at every layer of the stack. Models are commoditizing. No company should be dependent upon any one model or any one model’s harness. Over the weekend, Satya warned of a world where every company across every sector is ceding value to a few models that eat everything they see. AI that is intended for growth should amplify the intelligence of an organization so that it compounds from within.
Companies also need an observability platform that provides governance, management, security and Financial Operations (FinOps) to ensure the ROI with AI. This enables AI to be trusted within the environment over which it reasons and puts the business in control of the outcomes.
Intelligence + Trust is embedded across Microsoft 365 Copilot, GitHub Copilot and Copilot Studio, where model diversity aligns cost and performance to each task. Microsoft IQ optimizes workflows, so context is routed efficiently and reduces unnecessary compute. Agent 365 is the control plane to observe, govern, manage and secure agents. We have built a system to manage AI spend as a core enterprise capability, not an afterthought. It is delivered across clouds and model providers without locking customers into a single approach.
Managing costs at scale
As agent usage scales, organizations need a clear set of levers to manage cost:
Model diversity. Any given inferencing model, model harness or agentic loop on its own does not help build out an organization’s IQ in ways that compound its intelligence. Both Microsoft 365 Copilot and GitHub Copilot are model-diverse by design without locking customers into a single provider. Different models — like GPT-5.5 or Claude Opus 4.8 — serve distinct roles with different economics. Matching the right intelligence to each task optimizes performance and cost.
Your IQ. Agents struggle with raw data. Significant compute is spent interpreting structure and context before useful work begins. The Microsoft IQ platform empowers your IQ by turning raw data into usable intelligence, continuously building a semantic understanding of how your organization operates across Microsoft 365 and line-of-business systems. It provides agents with the context they need upfront rather than requiring them to reconstruct it. The result is measurable: faster execution, higher accuracy and lower token usage. This is how intelligence compounds within your organization.
Financial operations. FinOps became critical when companies moved to the cloud and requires even greater attention as AI shifts from fixed pricing to usage-driven models. With Foundry and Agent 365, we are providing tools to help our customers optimize their AI costs today.
Frontier business models
Business models are evolving as we use AI to drive business outcomes. The User Subscription License (USL) has become the foundation, providing a package of capabilities for a predictable per-user-per-month fee. Usage-based licensing has emerged for long-running, multi-tasking agents, where cost aligns directly to the work performed.
Microsoft gives customers a unique combination of business model flexibility and integrated product experiences that is unmatched in the market. Microsoft 365 Copilot and GitHub Copilot use both models — a USL offering with not only value and capabilities, but flexible consumption on top. Today we’re announcing the general availability of Copilot Cowork worldwide, which requires the Microsoft 365 Copilot USL and is then usage-based.
Our model-diverse strategy allows customers to purchase capacity with the flexibility to use the right model for the job based on model strengths, economics and the latest innovations. Microsoft Agent Factory provides a single consumption model spanning Microsoft 365 Copilot (including Cowork), GitHub Copilot and agents built in Fabric, Foundry and Copilot Studio.
Our integrated product experiences put AI in the flow of work for both knowledge workers and software developers and manage capacity fluidly across the two. Historically these personas have been distinct, but increasingly the line between them is blurring. Coding is becoming a mainstream knowledge worker skill and chat and Cowork are becoming modalities important for software development. With Microsoft 365 and GitHub, we offer market-leading tools for both roles and make it easy to seamlessly manage capacity based on availability and need.
Agent 365: The control plane
As organizations adopt agents from Microsoft, another provider or build their own, a control plane is essential. Agent 365 gives IT and security leaders a single place to observe, govern, manage and secure agents across the organization. It builds on the Microsoft stack that enterprises trust: Entra for identity, Defender for threat protection, Purview for data governance and Intune for endpoint management. We are extending Agent 365 to include cost management, so organizations can monitor and manage agent spend alongside security and compliance. As the Frontier Firm operating model takes hold, leaders will manage human and agentic work as a single system, with visibility into both performance and cost.
—
The two most essential elements in any AI solution are Intelligence + Trust. At Microsoft, this conviction shapes how we design every layer of our AI platform. Microsoft IQ enables organizations to harness their own unique IQ, bringing context to data and embedding AI directly into the flow of work to deliver faster, more accurate and more trusted outcomes while safeguarding assets and protecting intellectual property. Agent 365 provides that trust layer, ensuring every agent and AI artifact is observed across the environment so organizations can move decisively from experimentation to enterprise impact with confidence. As Jay Parikh put it at Build, AI alone will not change your business. The system running it will.
We have built this system for our customers and partners, where intelligence compounds from within and every agent operates with control, visibility and trust. Together, we can scale human ambition and define how AI delivers measurable business impact across every role, organization and industry.
Judson Althoff is the chief executive officer of the commercial business at Microsoft. He is responsible for the product strategy, sales, services, support, marketing, operations and revenue growth of the company’s commercial business, which operates in more than 120 regional and national subsidiaries globally.
The post Achieving success with AI appeared first on The Official Microsoft Blog.
The two most important elements in any AI solution are Intelligence + Trust. I first made this statement in November at our Ignite conference and my conviction is strengthened by every conversation I have with customers. Through my travels, three consistent topics are being raised when considering the adoption of AI solutions: Will AI amplify…
The post Achieving success with AI appeared first on The Official Microsoft Blog.Read More
3 dimension array?
Hi,
How to write 3 or 4 dimansion array?
Thanks,
HenryHi,
How to write 3 or 4 dimansion array?
Thanks,
Henry Hi,
How to write 3 or 4 dimansion array?
Thanks,
Henry MATLAB Answers — New Questions
Likely error when doing high dimensional permute of big gpu array
The following code reproduces what appears to be an error when using permute, specifically I permute a matrix contains all positive integers, but the permute output contains zeros.
To trigger the error seems to require three things:
(i) big, say >4gb, array (does not trigger on 3.5gb array)
(ii) gpu array (does not trigger for cpu array)
(iii) high dimensional permute (triggers with 6D, but not 2D)
Following is code to reproduce the issue, and below that a copy-paste of what is printed to command window.
[I use Matlab R2025b, my gpu is detailed in the output.]
%% permutetest.m
% There is an error when permuting BIG GPU arrays with HIGH dimensions.
%
% 1. Doing a permute on a 6D gpu array that is big (roughly >4gb) GIVES ERRORS, specifically this is the ‘Case 1’ below.
% The error is that many elements get replaced with zeros.
%
% 2. Doing the same, but on a smaller (<4gb) gpu array does not error (Case 2 below)
% 3. Redoing first two cases, but on the cpu does not error (Cases 3 and 4)
% 4. Redoing first two cases, but only having permute across 2D does not error (Cases 5 and 6).
%
% The matices being permuted contain integers between 1 and 100, so seems
% unlikely that the actual contents are relevant to the error but I have
% not attempted to test this.
clear all
disp(gpuDevice) % show GPU model + available memory
% Sizes via [4, X, 15, 5, 3, 100]: elements = 90000*X, bytes(double) = 720000*X.
Xmid = 5220; % 469,800,000 elems = 3,758,400,000 bytes = 3.500 GiB (~3.5 GB)
Xhigh = 5966; % 536,940,000 elems = 4,295,520,000 bytes = 4.000 GiB (just above 4 GB)
% mode ‘6D’ => permute(A,[1,2,4,5,3,6]) on the array as-is
% mode ‘2D’ => reshape A to a 2-D matrix [4*X, 22500] then permute(A,[2,1])
%%
cases = {
‘~4.0 GB, GPU, 6-D permute’, [4 Xhigh 15 5 3 100], ‘gpu’, ‘6D’; % big, gpu, high dim
‘~3.5 GB, GPU, 6-D permute’, [4 Xmid 15 5 3 100], ‘gpu’, ‘6D’; % small, gpu, high dim
‘~4.0 GB, CPU, 6-D permute’, [4 Xhigh 15 5 3 100], ‘cpu’, ‘6D’; % big, cpu, high dim
‘~3.5 GB, CPU, 6-D permute’, [4 Xmid 15 5 3 100], ‘cpu’, ‘6D’; % small, cpu, high dim
‘~4.0 GB, GPU, 2-D transpose’, [4 Xhigh 15 5 3 100], ‘gpu’, ‘2D’; % big, gpu, low dim
‘~3.5 GB, GPU, 2-D transpose’, [4 Xmid 15 5 3 100], ‘gpu’, ‘2D’; % small, gpu, low dim
};
%% Do each case and give feedback on results
for ii=1:size(cases,1)
label = cases{ii,1}; sz = cases{ii,2}; dev = cases{ii,3}; mode = cases{ii,4};
% Decide the actual array shape and the permutation order for this case
if strcmp(mode,’2D’)
asize = [sz(1)*sz(2), prod(sz(3:end))]; % e.g. [4*X, 22500]
perm = [2,1];
else
asize = sz;
perm = [1,2,4,5,3,6];
end
nel = prod(asize); nbytes = nel*8; % double = 8 bytes/element
fprintf(‘n===== %s | array=[%s] | perm=[%s] =====n’, label, num2str(asize), num2str(perm));
fprintf(‘ %d elements | %d bytes | %.4f GiB | device=%sn’, nel, nbytes, nbytes/2^30, dev);
%% Pre-permute
% Build with every element >= 1 (so any 0 in the output == corruption), on the chosen device
if strcmp(dev,’gpu’)
A = randi([1 100], asize, ‘gpuArray’); % double, on GPU
else
A = randi([1 100], asize); % double, on CPU
end
sumA = gather(sum(A(:))); % computed BEFORE any permute -> trustworthy
nzA = sum(A(:)==0);
% Double-check the count of zeros pre-permute [passes every time]
if nnz(A)~=(numel(A)-nzA)
error(‘Zero count seems wrong’)
end
fprintf(‘ input : min=%g #zeros=%d sum(A)=%.0fn’, gather(min(A(:))), gather(nzA), sumA);
%% Permute
B = permute(A, perm);
nnz1=nnz(B);
Bc = gather(B); % bring to host for trustworthy checks (no-op if already on CPU)
nnz2=nnz(Bc);
% Double-check that gather() is innocent [it is innocent, this never triggers]
if nnz1~=nnz2
error(‘gather() is not innocent’)
end
%% Post-permute
nzBc = sum(Bc(:)==0);
minB = min(Bc(:));
sumB = sum(Bc(:));
% Double-check the count of zeros post-permute [passes every time]
if nnz(Bc)~=(numel(Bc)-nzBc)
error(‘Zero count seems wrong’)
end
fprintf(‘ output: size=[%s] min=%g #zeros=%d sum(B)=%.0fn’, num2str(size(Bc)), minB, nzBc, sumB);
fprintf(‘ sum preserved? %d (lost %.1f%% of total)n’, sumA==sumB, 100*(sumA-sumB)/sumA);
if nzBc>0 || sumA~=sumB
fprintf(‘ >>> PERMUTE CORRUPTED THIS ARRAY (a faithful permute is impossible here) <<<n’);
else
fprintf(‘ OK: permute faithful (no zeros introduced, sum preserved).n’);
end
% Clean everything up between runs, to make sure nothing corrupts across runs
clear B Bc
clear A
reset(gpuDevice);% free GPU memory before the next allocation
end
fprintf(‘nDone.n’);
When this is run, the following is output to Command Window
>>permutetest
CUDADevice with properties:
Name: ‘NVIDIA RTX 4000 Ada Generation’
Index: 1 (of 1)
ComputeCapability: ‘8.9’
DriverModel: ‘N/A’
TotalMemory: 20991901696 (20.99 GB)
AvailableMemory: 20807024640 (20.81 GB)
DeviceAvailable: true
DeviceSelected: true
Show all properties.
===== ~4.0 GB, GPU, 6-D permute | array=[4 5966 15 5 3 100] | perm=[1 2 4 5 3 6] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=27115243076
output: size=[4 5966 5 3 15 100] min=0 #zeros=500387064 sum(B)=1845835241
sum preserved? 0 (lost 93.2% of total)
>>> PERMUTE CORRUPTED THIS ARRAY (a faithful permute is impossible here) <<<
===== ~3.5 GB, GPU, 6-D permute | array=[4 5220 15 5 3 100] | perm=[1 2 4 5 3 6] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=23724420469
output: size=[4 5220 5 3 15 100] min=1 #zeros=0 sum(B)=23724420469
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~4.0 GB, CPU, 6-D permute | array=[4 5966 15 5 3 100] | perm=[1 2 4 5 3 6] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=cpu
input : min=1 #zeros=0 sum(A)=27115350572
output: size=[4 5966 5 3 15 100] min=1 #zeros=0 sum(B)=27115350572
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~3.5 GB, CPU, 6-D permute | array=[4 5220 15 5 3 100] | perm=[1 2 4 5 3 6] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=cpu
input : min=1 #zeros=0 sum(A)=23724663007
output: size=[4 5220 5 3 15 100] min=1 #zeros=0 sum(B)=23724663007
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~4.0 GB, GPU, 2-D transpose | array=[23864 22500] | perm=[2 1] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=27115442092
output: size=[22500 23864] min=1 #zeros=0 sum(B)=27115442092
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~3.5 GB, GPU, 2-D transpose | array=[20880 22500] | perm=[2 1] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=23724054242
output: size=[22500 20880] min=1 #zeros=0 sum(B)=23724054242
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
Done.
>>The following code reproduces what appears to be an error when using permute, specifically I permute a matrix contains all positive integers, but the permute output contains zeros.
To trigger the error seems to require three things:
(i) big, say >4gb, array (does not trigger on 3.5gb array)
(ii) gpu array (does not trigger for cpu array)
(iii) high dimensional permute (triggers with 6D, but not 2D)
Following is code to reproduce the issue, and below that a copy-paste of what is printed to command window.
[I use Matlab R2025b, my gpu is detailed in the output.]
%% permutetest.m
% There is an error when permuting BIG GPU arrays with HIGH dimensions.
%
% 1. Doing a permute on a 6D gpu array that is big (roughly >4gb) GIVES ERRORS, specifically this is the ‘Case 1’ below.
% The error is that many elements get replaced with zeros.
%
% 2. Doing the same, but on a smaller (<4gb) gpu array does not error (Case 2 below)
% 3. Redoing first two cases, but on the cpu does not error (Cases 3 and 4)
% 4. Redoing first two cases, but only having permute across 2D does not error (Cases 5 and 6).
%
% The matices being permuted contain integers between 1 and 100, so seems
% unlikely that the actual contents are relevant to the error but I have
% not attempted to test this.
clear all
disp(gpuDevice) % show GPU model + available memory
% Sizes via [4, X, 15, 5, 3, 100]: elements = 90000*X, bytes(double) = 720000*X.
Xmid = 5220; % 469,800,000 elems = 3,758,400,000 bytes = 3.500 GiB (~3.5 GB)
Xhigh = 5966; % 536,940,000 elems = 4,295,520,000 bytes = 4.000 GiB (just above 4 GB)
% mode ‘6D’ => permute(A,[1,2,4,5,3,6]) on the array as-is
% mode ‘2D’ => reshape A to a 2-D matrix [4*X, 22500] then permute(A,[2,1])
%%
cases = {
‘~4.0 GB, GPU, 6-D permute’, [4 Xhigh 15 5 3 100], ‘gpu’, ‘6D’; % big, gpu, high dim
‘~3.5 GB, GPU, 6-D permute’, [4 Xmid 15 5 3 100], ‘gpu’, ‘6D’; % small, gpu, high dim
‘~4.0 GB, CPU, 6-D permute’, [4 Xhigh 15 5 3 100], ‘cpu’, ‘6D’; % big, cpu, high dim
‘~3.5 GB, CPU, 6-D permute’, [4 Xmid 15 5 3 100], ‘cpu’, ‘6D’; % small, cpu, high dim
‘~4.0 GB, GPU, 2-D transpose’, [4 Xhigh 15 5 3 100], ‘gpu’, ‘2D’; % big, gpu, low dim
‘~3.5 GB, GPU, 2-D transpose’, [4 Xmid 15 5 3 100], ‘gpu’, ‘2D’; % small, gpu, low dim
};
%% Do each case and give feedback on results
for ii=1:size(cases,1)
label = cases{ii,1}; sz = cases{ii,2}; dev = cases{ii,3}; mode = cases{ii,4};
% Decide the actual array shape and the permutation order for this case
if strcmp(mode,’2D’)
asize = [sz(1)*sz(2), prod(sz(3:end))]; % e.g. [4*X, 22500]
perm = [2,1];
else
asize = sz;
perm = [1,2,4,5,3,6];
end
nel = prod(asize); nbytes = nel*8; % double = 8 bytes/element
fprintf(‘n===== %s | array=[%s] | perm=[%s] =====n’, label, num2str(asize), num2str(perm));
fprintf(‘ %d elements | %d bytes | %.4f GiB | device=%sn’, nel, nbytes, nbytes/2^30, dev);
%% Pre-permute
% Build with every element >= 1 (so any 0 in the output == corruption), on the chosen device
if strcmp(dev,’gpu’)
A = randi([1 100], asize, ‘gpuArray’); % double, on GPU
else
A = randi([1 100], asize); % double, on CPU
end
sumA = gather(sum(A(:))); % computed BEFORE any permute -> trustworthy
nzA = sum(A(:)==0);
% Double-check the count of zeros pre-permute [passes every time]
if nnz(A)~=(numel(A)-nzA)
error(‘Zero count seems wrong’)
end
fprintf(‘ input : min=%g #zeros=%d sum(A)=%.0fn’, gather(min(A(:))), gather(nzA), sumA);
%% Permute
B = permute(A, perm);
nnz1=nnz(B);
Bc = gather(B); % bring to host for trustworthy checks (no-op if already on CPU)
nnz2=nnz(Bc);
% Double-check that gather() is innocent [it is innocent, this never triggers]
if nnz1~=nnz2
error(‘gather() is not innocent’)
end
%% Post-permute
nzBc = sum(Bc(:)==0);
minB = min(Bc(:));
sumB = sum(Bc(:));
% Double-check the count of zeros post-permute [passes every time]
if nnz(Bc)~=(numel(Bc)-nzBc)
error(‘Zero count seems wrong’)
end
fprintf(‘ output: size=[%s] min=%g #zeros=%d sum(B)=%.0fn’, num2str(size(Bc)), minB, nzBc, sumB);
fprintf(‘ sum preserved? %d (lost %.1f%% of total)n’, sumA==sumB, 100*(sumA-sumB)/sumA);
if nzBc>0 || sumA~=sumB
fprintf(‘ >>> PERMUTE CORRUPTED THIS ARRAY (a faithful permute is impossible here) <<<n’);
else
fprintf(‘ OK: permute faithful (no zeros introduced, sum preserved).n’);
end
% Clean everything up between runs, to make sure nothing corrupts across runs
clear B Bc
clear A
reset(gpuDevice);% free GPU memory before the next allocation
end
fprintf(‘nDone.n’);
When this is run, the following is output to Command Window
>>permutetest
CUDADevice with properties:
Name: ‘NVIDIA RTX 4000 Ada Generation’
Index: 1 (of 1)
ComputeCapability: ‘8.9’
DriverModel: ‘N/A’
TotalMemory: 20991901696 (20.99 GB)
AvailableMemory: 20807024640 (20.81 GB)
DeviceAvailable: true
DeviceSelected: true
Show all properties.
===== ~4.0 GB, GPU, 6-D permute | array=[4 5966 15 5 3 100] | perm=[1 2 4 5 3 6] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=27115243076
output: size=[4 5966 5 3 15 100] min=0 #zeros=500387064 sum(B)=1845835241
sum preserved? 0 (lost 93.2% of total)
>>> PERMUTE CORRUPTED THIS ARRAY (a faithful permute is impossible here) <<<
===== ~3.5 GB, GPU, 6-D permute | array=[4 5220 15 5 3 100] | perm=[1 2 4 5 3 6] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=23724420469
output: size=[4 5220 5 3 15 100] min=1 #zeros=0 sum(B)=23724420469
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~4.0 GB, CPU, 6-D permute | array=[4 5966 15 5 3 100] | perm=[1 2 4 5 3 6] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=cpu
input : min=1 #zeros=0 sum(A)=27115350572
output: size=[4 5966 5 3 15 100] min=1 #zeros=0 sum(B)=27115350572
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~3.5 GB, CPU, 6-D permute | array=[4 5220 15 5 3 100] | perm=[1 2 4 5 3 6] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=cpu
input : min=1 #zeros=0 sum(A)=23724663007
output: size=[4 5220 5 3 15 100] min=1 #zeros=0 sum(B)=23724663007
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~4.0 GB, GPU, 2-D transpose | array=[23864 22500] | perm=[2 1] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=27115442092
output: size=[22500 23864] min=1 #zeros=0 sum(B)=27115442092
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~3.5 GB, GPU, 2-D transpose | array=[20880 22500] | perm=[2 1] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=23724054242
output: size=[22500 20880] min=1 #zeros=0 sum(B)=23724054242
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
Done.
>> The following code reproduces what appears to be an error when using permute, specifically I permute a matrix contains all positive integers, but the permute output contains zeros.
To trigger the error seems to require three things:
(i) big, say >4gb, array (does not trigger on 3.5gb array)
(ii) gpu array (does not trigger for cpu array)
(iii) high dimensional permute (triggers with 6D, but not 2D)
Following is code to reproduce the issue, and below that a copy-paste of what is printed to command window.
[I use Matlab R2025b, my gpu is detailed in the output.]
%% permutetest.m
% There is an error when permuting BIG GPU arrays with HIGH dimensions.
%
% 1. Doing a permute on a 6D gpu array that is big (roughly >4gb) GIVES ERRORS, specifically this is the ‘Case 1’ below.
% The error is that many elements get replaced with zeros.
%
% 2. Doing the same, but on a smaller (<4gb) gpu array does not error (Case 2 below)
% 3. Redoing first two cases, but on the cpu does not error (Cases 3 and 4)
% 4. Redoing first two cases, but only having permute across 2D does not error (Cases 5 and 6).
%
% The matices being permuted contain integers between 1 and 100, so seems
% unlikely that the actual contents are relevant to the error but I have
% not attempted to test this.
clear all
disp(gpuDevice) % show GPU model + available memory
% Sizes via [4, X, 15, 5, 3, 100]: elements = 90000*X, bytes(double) = 720000*X.
Xmid = 5220; % 469,800,000 elems = 3,758,400,000 bytes = 3.500 GiB (~3.5 GB)
Xhigh = 5966; % 536,940,000 elems = 4,295,520,000 bytes = 4.000 GiB (just above 4 GB)
% mode ‘6D’ => permute(A,[1,2,4,5,3,6]) on the array as-is
% mode ‘2D’ => reshape A to a 2-D matrix [4*X, 22500] then permute(A,[2,1])
%%
cases = {
‘~4.0 GB, GPU, 6-D permute’, [4 Xhigh 15 5 3 100], ‘gpu’, ‘6D’; % big, gpu, high dim
‘~3.5 GB, GPU, 6-D permute’, [4 Xmid 15 5 3 100], ‘gpu’, ‘6D’; % small, gpu, high dim
‘~4.0 GB, CPU, 6-D permute’, [4 Xhigh 15 5 3 100], ‘cpu’, ‘6D’; % big, cpu, high dim
‘~3.5 GB, CPU, 6-D permute’, [4 Xmid 15 5 3 100], ‘cpu’, ‘6D’; % small, cpu, high dim
‘~4.0 GB, GPU, 2-D transpose’, [4 Xhigh 15 5 3 100], ‘gpu’, ‘2D’; % big, gpu, low dim
‘~3.5 GB, GPU, 2-D transpose’, [4 Xmid 15 5 3 100], ‘gpu’, ‘2D’; % small, gpu, low dim
};
%% Do each case and give feedback on results
for ii=1:size(cases,1)
label = cases{ii,1}; sz = cases{ii,2}; dev = cases{ii,3}; mode = cases{ii,4};
% Decide the actual array shape and the permutation order for this case
if strcmp(mode,’2D’)
asize = [sz(1)*sz(2), prod(sz(3:end))]; % e.g. [4*X, 22500]
perm = [2,1];
else
asize = sz;
perm = [1,2,4,5,3,6];
end
nel = prod(asize); nbytes = nel*8; % double = 8 bytes/element
fprintf(‘n===== %s | array=[%s] | perm=[%s] =====n’, label, num2str(asize), num2str(perm));
fprintf(‘ %d elements | %d bytes | %.4f GiB | device=%sn’, nel, nbytes, nbytes/2^30, dev);
%% Pre-permute
% Build with every element >= 1 (so any 0 in the output == corruption), on the chosen device
if strcmp(dev,’gpu’)
A = randi([1 100], asize, ‘gpuArray’); % double, on GPU
else
A = randi([1 100], asize); % double, on CPU
end
sumA = gather(sum(A(:))); % computed BEFORE any permute -> trustworthy
nzA = sum(A(:)==0);
% Double-check the count of zeros pre-permute [passes every time]
if nnz(A)~=(numel(A)-nzA)
error(‘Zero count seems wrong’)
end
fprintf(‘ input : min=%g #zeros=%d sum(A)=%.0fn’, gather(min(A(:))), gather(nzA), sumA);
%% Permute
B = permute(A, perm);
nnz1=nnz(B);
Bc = gather(B); % bring to host for trustworthy checks (no-op if already on CPU)
nnz2=nnz(Bc);
% Double-check that gather() is innocent [it is innocent, this never triggers]
if nnz1~=nnz2
error(‘gather() is not innocent’)
end
%% Post-permute
nzBc = sum(Bc(:)==0);
minB = min(Bc(:));
sumB = sum(Bc(:));
% Double-check the count of zeros post-permute [passes every time]
if nnz(Bc)~=(numel(Bc)-nzBc)
error(‘Zero count seems wrong’)
end
fprintf(‘ output: size=[%s] min=%g #zeros=%d sum(B)=%.0fn’, num2str(size(Bc)), minB, nzBc, sumB);
fprintf(‘ sum preserved? %d (lost %.1f%% of total)n’, sumA==sumB, 100*(sumA-sumB)/sumA);
if nzBc>0 || sumA~=sumB
fprintf(‘ >>> PERMUTE CORRUPTED THIS ARRAY (a faithful permute is impossible here) <<<n’);
else
fprintf(‘ OK: permute faithful (no zeros introduced, sum preserved).n’);
end
% Clean everything up between runs, to make sure nothing corrupts across runs
clear B Bc
clear A
reset(gpuDevice);% free GPU memory before the next allocation
end
fprintf(‘nDone.n’);
When this is run, the following is output to Command Window
>>permutetest
CUDADevice with properties:
Name: ‘NVIDIA RTX 4000 Ada Generation’
Index: 1 (of 1)
ComputeCapability: ‘8.9’
DriverModel: ‘N/A’
TotalMemory: 20991901696 (20.99 GB)
AvailableMemory: 20807024640 (20.81 GB)
DeviceAvailable: true
DeviceSelected: true
Show all properties.
===== ~4.0 GB, GPU, 6-D permute | array=[4 5966 15 5 3 100] | perm=[1 2 4 5 3 6] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=27115243076
output: size=[4 5966 5 3 15 100] min=0 #zeros=500387064 sum(B)=1845835241
sum preserved? 0 (lost 93.2% of total)
>>> PERMUTE CORRUPTED THIS ARRAY (a faithful permute is impossible here) <<<
===== ~3.5 GB, GPU, 6-D permute | array=[4 5220 15 5 3 100] | perm=[1 2 4 5 3 6] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=23724420469
output: size=[4 5220 5 3 15 100] min=1 #zeros=0 sum(B)=23724420469
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~4.0 GB, CPU, 6-D permute | array=[4 5966 15 5 3 100] | perm=[1 2 4 5 3 6] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=cpu
input : min=1 #zeros=0 sum(A)=27115350572
output: size=[4 5966 5 3 15 100] min=1 #zeros=0 sum(B)=27115350572
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~3.5 GB, CPU, 6-D permute | array=[4 5220 15 5 3 100] | perm=[1 2 4 5 3 6] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=cpu
input : min=1 #zeros=0 sum(A)=23724663007
output: size=[4 5220 5 3 15 100] min=1 #zeros=0 sum(B)=23724663007
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~4.0 GB, GPU, 2-D transpose | array=[23864 22500] | perm=[2 1] =====
536940000 elements | 4295520000 bytes | 4.0005 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=27115442092
output: size=[22500 23864] min=1 #zeros=0 sum(B)=27115442092
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
===== ~3.5 GB, GPU, 2-D transpose | array=[20880 22500] | perm=[2 1] =====
469800000 elements | 3758400000 bytes | 3.5003 GiB | device=gpu
input : min=1 #zeros=0 sum(A)=23724054242
output: size=[22500 20880] min=1 #zeros=0 sum(B)=23724054242
sum preserved? 1 (lost 0.0% of total)
OK: permute faithful (no zeros introduced, sum preserved).
Done.
>> gpu, permute MATLAB Answers — New Questions
reading text and reformatting for excel
Another member of my team has created a modelling programme which outputs data that looks like this:
Train MWh consumed MWh regen V_av. Umean_tr Min V @ km Max V Max Delay(s) @ station
01_02_01 0.2498 -0.0209 1.5755 1.474 1.1937 0.027523 1.8
01_02_02 0.2496 -0.0259 1.5717 1.4722 1.1937 0.027523 1.7963
01_02_03 0.2496 -0.0277 1.569 1.4723 1.1937 0.027523 1.7963
01_02_04 0.2494 -0.0299 1.5628 1.4614 1.1938 0.027523 1.798
01_02_05 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_06 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_07 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_08 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_09 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_10 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_11 0.2497 -0.0296 1.5629 1.4621 1.1941 0.027523 1.7985
01_02_12 0.2497 -0.0272 1.5691 1.4646 1.1941 0.027523 1.8
I want to read the ‘table’ and reformat it into excel. Is that likely to be simple or should I delve into the depths of his programme and print them to the excel sheet directly?Another member of my team has created a modelling programme which outputs data that looks like this:
Train MWh consumed MWh regen V_av. Umean_tr Min V @ km Max V Max Delay(s) @ station
01_02_01 0.2498 -0.0209 1.5755 1.474 1.1937 0.027523 1.8
01_02_02 0.2496 -0.0259 1.5717 1.4722 1.1937 0.027523 1.7963
01_02_03 0.2496 -0.0277 1.569 1.4723 1.1937 0.027523 1.7963
01_02_04 0.2494 -0.0299 1.5628 1.4614 1.1938 0.027523 1.798
01_02_05 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_06 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_07 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_08 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_09 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_10 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_11 0.2497 -0.0296 1.5629 1.4621 1.1941 0.027523 1.7985
01_02_12 0.2497 -0.0272 1.5691 1.4646 1.1941 0.027523 1.8
I want to read the ‘table’ and reformat it into excel. Is that likely to be simple or should I delve into the depths of his programme and print them to the excel sheet directly? Another member of my team has created a modelling programme which outputs data that looks like this:
Train MWh consumed MWh regen V_av. Umean_tr Min V @ km Max V Max Delay(s) @ station
01_02_01 0.2498 -0.0209 1.5755 1.474 1.1937 0.027523 1.8
01_02_02 0.2496 -0.0259 1.5717 1.4722 1.1937 0.027523 1.7963
01_02_03 0.2496 -0.0277 1.569 1.4723 1.1937 0.027523 1.7963
01_02_04 0.2494 -0.0299 1.5628 1.4614 1.1938 0.027523 1.798
01_02_05 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_06 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_07 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_08 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_09 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_10 0.2497 -0.0299 1.5628 1.4621 1.1941 0.027523 1.7974
01_02_11 0.2497 -0.0296 1.5629 1.4621 1.1941 0.027523 1.7985
01_02_12 0.2497 -0.0272 1.5691 1.4646 1.1941 0.027523 1.8
I want to read the ‘table’ and reformat it into excel. Is that likely to be simple or should I delve into the depths of his programme and print them to the excel sheet directly? text file, excel, export, output, matrix, strings MATLAB Answers — New Questions
Getting wrong output when Modelling a VFD powered by a generator, feeding a motor
Hello Everyone, I am trying to model an VFD which is powered by an AC Generator, feeding an induction motor. I got a model online, where the guy takes a pure DC supply as the source. I modified his model, replacing it with AC Supply and a rectifier. The model works well with DC supply, however it gives wrong output when a AC Generator with a rectifier is connected.
Below is the model powered by a DC source, this works perfectly.
Below is the model with AC source, this gives wierd outputs.
This is the voltage produced by rectifier
This is the Voltage Produced by invertor
Below is the motor torque and rpm
I would really appreciate if someone can help me figure out what is wrong in my system, Thanks.Hello Everyone, I am trying to model an VFD which is powered by an AC Generator, feeding an induction motor. I got a model online, where the guy takes a pure DC supply as the source. I modified his model, replacing it with AC Supply and a rectifier. The model works well with DC supply, however it gives wrong output when a AC Generator with a rectifier is connected.
Below is the model powered by a DC source, this works perfectly.
Below is the model with AC source, this gives wierd outputs.
This is the voltage produced by rectifier
This is the Voltage Produced by invertor
Below is the motor torque and rpm
I would really appreciate if someone can help me figure out what is wrong in my system, Thanks. Hello Everyone, I am trying to model an VFD which is powered by an AC Generator, feeding an induction motor. I got a model online, where the guy takes a pure DC supply as the source. I modified his model, replacing it with AC Supply and a rectifier. The model works well with DC supply, however it gives wrong output when a AC Generator with a rectifier is connected.
Below is the model powered by a DC source, this works perfectly.
Below is the model with AC source, this gives wierd outputs.
This is the voltage produced by rectifier
This is the Voltage Produced by invertor
Below is the motor torque and rpm
I would really appreciate if someone can help me figure out what is wrong in my system, Thanks. motor, generator, specialized power systems, sps MATLAB Answers — New Questions
How Much Will the July 2026 License Increases Cost Your Tenant?
Monthly License Increases Coming Soon
Recently, I discussed how to find stale or inactive licensed user accounts. With Microsoft’s July 1 license increases coming up, the aim is to make sure that tenants don’t pay for licenses that are not in active use. Reviewing licenses regularly should be a top priority of tenant administrators and using PowerShell to automate that process just makes sense.
License Increases Cover More than Microsoft 365
Although the monthly price increases for Microsoft 365 licenses received most attention, Microsoft will increase prices for other common licenses too. If your tenant uses the Enterprise Mobility and Security Suite (EMS), you’ll pay an extra 13% for an E3 license and an extra 10% for an E5 license. Upticks are also coming for Entra P1 (16%) and P2 (11%) licenses, needed for important features like conditional access policies.
Given different countries, tax regimes, discounts negotiated with Microsoft, and varying increases across SKUs, knowing exactly how much extra a specific tenant’s licensing mix will be is difficult. But let’s take a stab at it using PowerShell to fetch licensing data from Entra ID and apply the information we know about new and old prices for the different SKUs. I use the U.S. prices and increases for this example.
The script uses the Microsoft Graph PowerShell SDK. The User.Read.All and LicenseAssignment.Read.All permissions are required to read user account information (including assigned licenses) and the tenant subscriptions (products used in the tenant).
Building an Array of License Increases
The first thing to do is to build an array of SKUs and monthly price increases. The data could be read in from a spreadsheet or CSV file, but my script creates the data as an array of PowerShell custom objects. An object contains the SKU identifier (GUID), its name, and price details:
[PSCustomObject]@{
SkuId = "cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46"
Name = "Microsoft 365 Business Standard"
IncreasePercent = 12
OldPrice = '12.50'
NewPrice = '14'
}
Finding Tenant Subscriptions with Monthly License Increases
Next, use the Get-MgSubscribedSku cmdlet to fetch details for the commercial subscriptions known in the tenant. This information can be matched against the array of license increases to produce the set of increases applicable to the tenant:
# Get tenant subscriptions and figure out which ones are affected by the price increases.
$TenantSkus = Get-MgSubscribedSku -All | Select-Object SkuId, SkuPartNumber,
@{Name="ConsumedUnits";Expression={$_.ConsumedUnits}},
@{Name="EnabledUnits";Expression={$_.PrepaidUnits.Enabled}}
# Join with price increases on SkuId
$IncreasedLicenses = ForEach ($Sku in $TenantSkus) {
$Match = $Microsoft365PriceIncreases | Where-Object { $_.SkuId -eq $Sku.SkuId }
If ($Match) {
[PSCustomObject]@{
Name = $Match.Name
SkuId = $Sku.SkuId
SkuPartNumber = $Sku.SkuPartNumber
ConsumedUnits = $Sku.ConsumedUnits
EnabledUnits = $Sku.EnabledUnits
IncreasePercent = $Match.IncreasePercent
OldPrice = $Match.OldPrice
NewPrice = $Match.NewPrice
}
}
}
In my tenant, I found three subscriptions affected by the monthly license increases:
Licenses with price increases: Name SkuPartNumber ConsumedUnits OldPrice NewPrice ---- ------------- ------------- -------- -------- Office 365 E3 ENTERPRISEPACK 25 23 26 Microsoft 365 E5 without Teams O365_w/o_Teams_Bundle_M5 10 48.45 51.45 Office 365 E5 without Teams Office_365_w/o_Teams_Bundle_E5 5 29.45 32.45
Generating Per-User Monthly License Increase Data
After the script determines what license increases apply to tenant subscriptions, calculating what the additional cost will be is a matter of finding the set of licensed user accounts and checking which accounts have the affected licenses. Two approaches can be taken:
- In small to medium tenants, a single Get-MgUser command can find all licensed accounts and a loop can check each account for the affected licenses.
- In larger tenants (over 10,000 accounts), it might be better to use separate Get-MgUser commands to fetch the accounts affected by each license and combine the results into a single set.
In either case, the result should be a list of accounts assigned licenses with increased prices. This information can be analyzed to generate the final results with the bottom line for the tenant (Figure 1).

The outcome isn’t guaranteed to be 100% for your tenant. Too many variables can affect the final price, but it will certainly give some guidance as to what kind of monthly price increase will come into effect on July 1, 2026.
You can grab the code for the script that I used from the Office 365 for IT Pros GitHub repository.
Using PowerShell to answer questions about Microsoft 365 tenant operations is exactly the reason why we wrote the Automating Microsoft 365 with PowerShell eBook, available standalone or as part of the Office 365 for IT Pros eBook bundle. Over hour hundred pages of knowledge (not AI-generated) showing how to solve real-world problems.
How do I increase the fontsize used to display text in the Copilot Chat window of the Matlab IDE?
How do I increase the fontsize used to display text in the Copilot Chat window of the Matlab IDE?How do I increase the fontsize used to display text in the Copilot Chat window of the Matlab IDE? How do I increase the fontsize used to display text in the Copilot Chat window of the Matlab IDE? copilot chat MATLAB Answers — New Questions
Accessing a single GPU from different workers of a parpool thread pool
It used to be conventional wisdom that parfor does not play well together with gpuArray on a single-GPU system because different parpool workers end up competing for the same CPU-GPU communication channel. Is that still true now that there is a distinction between process pools and thread pools? Can it be worthwhile to parfor-parallelize a loop containing gpuArray operations if I have only a single GPU?It used to be conventional wisdom that parfor does not play well together with gpuArray on a single-GPU system because different parpool workers end up competing for the same CPU-GPU communication channel. Is that still true now that there is a distinction between process pools and thread pools? Can it be worthwhile to parfor-parallelize a loop containing gpuArray operations if I have only a single GPU? It used to be conventional wisdom that parfor does not play well together with gpuArray on a single-GPU system because different parpool workers end up competing for the same CPU-GPU communication channel. Is that still true now that there is a distinction between process pools and thread pools? Can it be worthwhile to parfor-parallelize a loop containing gpuArray operations if I have only a single GPU? gpu, parpool, thread pools, process pools MATLAB Answers — New Questions
Initialization in Simulink
Is it possible to run a Simulink model with model variables initialized directly from a stored file accessed by Simulink instead of being them being initialized within MATLAB? Whenever I run a Simulink model it seems that I first have to assign values to any MATLAB workspace variables by going into MATLAB- it would be easier if they could be automatically initialized within Simulink. Is that possible?Is it possible to run a Simulink model with model variables initialized directly from a stored file accessed by Simulink instead of being them being initialized within MATLAB? Whenever I run a Simulink model it seems that I first have to assign values to any MATLAB workspace variables by going into MATLAB- it would be easier if they could be automatically initialized within Simulink. Is that possible? Is it possible to run a Simulink model with model variables initialized directly from a stored file accessed by Simulink instead of being them being initialized within MATLAB? Whenever I run a Simulink model it seems that I first have to assign values to any MATLAB workspace variables by going into MATLAB- it would be easier if they could be automatically initialized within Simulink. Is that possible? eric1, callback MATLAB Answers — New Questions
Overwriting table columns with ()-indexing
Suppose I have two tables,
T1=array2table(rand(5,3))
T2=array2table(char(randi([65,90],5,3)),Var={‘Col1′,’Col2′,’Col3’})
I wish to replace the final column of T1 with that of T2. One way to accomplish this is,
T3=[T1(:,1:2) , T2(:,3) ]
Why, though, does this indexing approach not give the same result?
T3=T1;
T3(:,3)=T2(:,3)
The result is the same as what would be obtained with brace indexing,
T3=T1;
T3{:,3}=T2{:,3}
I understand why brace-indexing gives this result, but I thought ()-indexing was supposed to keep the data contained in a table. Why don’t the tabular properties of T2(:,3), like the column name and data type, get transfered as well when parentheses are used?Suppose I have two tables,
T1=array2table(rand(5,3))
T2=array2table(char(randi([65,90],5,3)),Var={‘Col1′,’Col2′,’Col3’})
I wish to replace the final column of T1 with that of T2. One way to accomplish this is,
T3=[T1(:,1:2) , T2(:,3) ]
Why, though, does this indexing approach not give the same result?
T3=T1;
T3(:,3)=T2(:,3)
The result is the same as what would be obtained with brace indexing,
T3=T1;
T3{:,3}=T2{:,3}
I understand why brace-indexing gives this result, but I thought ()-indexing was supposed to keep the data contained in a table. Why don’t the tabular properties of T2(:,3), like the column name and data type, get transfered as well when parentheses are used? Suppose I have two tables,
T1=array2table(rand(5,3))
T2=array2table(char(randi([65,90],5,3)),Var={‘Col1′,’Col2′,’Col3’})
I wish to replace the final column of T1 with that of T2. One way to accomplish this is,
T3=[T1(:,1:2) , T2(:,3) ]
Why, though, does this indexing approach not give the same result?
T3=T1;
T3(:,3)=T2(:,3)
The result is the same as what would be obtained with brace indexing,
T3=T1;
T3{:,3}=T2{:,3}
I understand why brace-indexing gives this result, but I thought ()-indexing was supposed to keep the data contained in a table. Why don’t the tabular properties of T2(:,3), like the column name and data type, get transfered as well when parentheses are used? table, indexing MATLAB Answers — New Questions
How to Remove Teams Chat Threads with PowerShell
Remove Problematic Chat Threads with the Remove-MgChat Cmdlet
Recently, a fellow MVP was looking for a way to remove Teams chats from user accounts. Someone apparently created a group chat, added everyone in the organization, and proceeded to spam the group with some “interesting” thoughts. It’s the kind of thing that we used the now-deprecated Search-Mailbox cmdlet to clean up. Microsoft’s current answer for email cleanup is Purview Priority Cleanup, but that solution doesn’t support Teams.
In any case, I pointed my colleague to a article I wrote in September 2023. The article describes an Azure Automation runbook that scans user accounts to find chat threads deemed problematic by the organization and calls the Remove-MgChat cmdlet to remove the offending chats.
Time to Improve Old Code
I hate looking at old code, especially old code written by me, especially when that code was written to prove a principal instead of being especially useful. It was time to crack open Visual Studio Code to fix some obvious issues (like replacing beta cmdlets with production cmdlets from the latest version of the Microsoft Graph PowerShell SDK) and add functionality. As is the nature of code updates, I ended up doing more work than anticipated to:
- Add better error checking.
- Refine the set of accounts processed by the script to just the set with licenses that include the Teams service plan.
- Check for problem text in the body of chat messages rather than just the name of chat topics.
- Expand the set of chats checked to include one-on-one conversations. Previously only group and meeting chats were checked.
- Use the ImportExcel module (if available) or ConvertTo-CSV cmdlet to create an output file that ends up as an attachment for the email sent at the end of the script (Figure 1).
- Generally, smarten up the code whenever I saw an opportunity to improve something.

Finding Chat Threads, Chat Messages, and Removing Unwanted Material
The code uses the Get-MgUserChat cmdlet to fetch chat threads for a user. One change I made is to limit the chats to those created in the last month on the basis that problematic chat threads are usually reported soon after they’re created. It’s easy to adjust the filter used to find chats, but remember that the bigger the period searched, the longer it will take Get-MgUserChat to find the chat threads.
Examining the chat threads will find problems in chat topics (names). To find problems in the actual messages, we need to call Get-MgChatMessage. There can be many messages in a chat thread, and a fast method is needed to check the content of each message. A compiled regex pattern is a good choice in these scenarios. Here’s what I did:
[array]$Topics = "Management are idiots", "Sensitive Stuff", "Project Aurora", "Stock tips", "Inappropriate content"
$Pattern = ($Topics | ForEach-Object {[regex]::Escape($_)}) -join "|"
$Regex = [regex]::new($Pattern, [System.Text.RegularExpressions.RegexOptions]::IgnoreCase)
To process the messages in a chat thread, we do the following to extract the content from each message, strip the HTML tags from the content, and check the content against the regex pattern:
[array]$Messages = Get-MgChatMessage -ChatId $Chat.Id -All
ForEach ($Message in $Messages) {
# Strip out HTML tags
$Content = ($Message.Body.Content -replace '<[^>]+>', '')
# Check messages to see if they contain any of the topics we're looking for.
# If so, the thread should be deleted. We only need one message to match to
# delete the thread, so we can stop checking after the first match.
If ($Regex.IsMatch($Content) -and $DeleteThread -eq $false) {
Write-Output ("Found chat message with matching content in chat {0} for user {1}" -f $Chat.Id, $User.displayName)
$DeleteThread = $true
$TopicFound = "Content"
}
}
Once the code finds a problem in a chat thread or individual message, it flags the thread for deletion. Remove-MgChat performs the actual removal against the Teams message store. It takes a little time before the deletion synchronizes down to clients to remove the thread from user view.
Getting the Code
You can download the updated script from the Office 365 for IT Pros GitHub repository. The code will run interactively (in app-only mode unless you only want to process Teams chats for the signed-in user) or as an Azure Automation runbook. The runtime environment needs the authentication, users, and Teams modules from the Microsoft Graph PowerShell SDK. The automation account must be assigned the application Graph permissions listed in the script.
I’m sure that people will have ideas of how to improve the script. Don’t be shy about discussing those ideas in GitHub.
Need help to write and manage PowerShell scripts for Microsoft 365, including Azure Automation runbooks? Get a copy of the Automating Microsoft 365 with PowerShell eBook, available standalone or as part of the Office 365 for IT Pros eBook bundle.









