Month: February 2026
Primer: Use RBAC for Applications to Control App Use of the Mail.Send Permission
Demise of SMTP AUTH Means Potential Misuse of the Mail.Send Permission
With time slipping away as Microsoft moves to retire basic authentication for the SMTP AUTH client submission protocol from Exchange Online, tenants must update PowerShell scripts that send email using SMTP AUTH and replace the Send-MailMessage cmdlet (which uses basic authentication) with an alternative based on OAuth, In many cases, the easiest way to upgrade is to ruse the Send-MgUserMail cmdlet from the Microsoft Graph PowerShell SDK (or the underlying Graph API request). The cmdlet uses OAuth to secure its connection to an Exchange Online mailbox to submit and send email.
Send-MgUserMail depends on the Graph Mail.Send permission. In its delegated form, the permission allows a message to be sent from the mailbox of the signed-in user. The application form of Mail.Send is a high-profile permission that allows an app to send email from any mailbox. In effect, the Mail.Send application permission allows an app to impersonate any user when sending email. Mail.Read is another high-profile permission that allows apps to read content from any mailbox.
When updating scripts under time pressure, the temptation often exists to take the quick and easy path. In practice, this can lead to administrators granting scripts consent to access mailboxes without guard rails. Fortunately, a solution exists: use RBAC for Applications to restrict app access to selected mailboxes.
RBAC for Applications
Microsoft launched RBAC for Applications in December 2022. The mechanism depends on scripts being executed in app-only mode (including for Azure Automation runbooks) because RBAC for Applications uses apps as the basis for assigning permission to access Exchange Online data. Over three years on, the number of scripts that make unrestricted use of the Mail.Send permission is testament that many script developers are unaware that they should and can restrict access to mailboxes in scripts. It’s possible that a lack of knowledge is the root cause, so let’s explain how to apply RBAC for Applications to a script. Further information is available in Microsoft’s documentation.
As an example, I use the script to report Microsoft 365 service health data via email. An updated version of the script that can run in delegated or app-only mode can be downloaded from the Office 365 for IT Pros GitHub repository.
Create a Registered Application
We need an app for RBAC for Applications to work, so the first task is to create a new registered app, which I called Service Health Notifications (Figure 1). You can see that the app has consent for application permissions to read the organization directory and to read service health and message data. RBAC for Applications only controls access to Exchange Online data. For other data, apps still need consent for Graph (and perhaps other) permissions.

The app has no consent to use the Mail.Send permission, so a script that connects to the Microsoft Graph using this app cannot send email. RBAC for Applications will grant the necessary access.
Create the Service Principal
The link between RBAC for Applications and the Entra ID app is via a service principal object. This is an Exchange Online service principal rather than the Entra ID service principals that are usually discussed when referring to apps. To create the service principal, we need:
- The application identifier.
- The identifier of the Entra ID service principal for the application.
- The application’s name.
This information can be found by looking up the Entra ID service principal before creating the service principal with the New-ServicePrincipal cmdlet. You’ll need to sign into Exchange Online PowerShell as an administrator before you can create a service principal, management scope, or management role assignment:
$SP = Get-MgServicePrincipal -Filter "displayName eq 'Service Health Notifications'" New-ServicePrincipal -AppId $SP.AppId -ObjectId $SP.Id -DisplayName $SP.DisplayName DisplayName ObjectId AppId ----------- -------- ----- Service Health Notifications e6105d20-c4f6-4bc6-bdc7-7a07e6f6e242 a40e80e0-7e1b-4339-a961-d6ecbc0ec7e1
Create the Management Scope
A management scope identifies a set of mailboxes for RBAC of Applications to assign permissions over. Any of the filterable mailbox properties can be used in a management scope. Our app needs access to send email from a specific mailbox, which we can identify with its display name:
New-ManagementScope -Name "Azure Management Account" -RecipientRestrictionFilter "displayName -eq 'Azure Management Account'"
Before creating the service principal, it’s a good idea to check that the filter returns the correct objects by running the filter with the Get-Recipient cmdlet:
Get-Recipient -RecipientPreviewFilter "displayName -eq 'Azure Management Account'"| Format-Table DisplayName, PrimarySMTPAddress DisplayName PrimarySmtpAddress ----------- ------------------ Azure Management Account Azure.Management.Mailbox@office365itpros.com
Create the Management Role Assignment
A management role assignment connects an app, target mailboxes (scope), and an application permission. In our case, we want to connect the app with the management scope that we just created and the “Application Mail.Send” permission. You can see the set of available permissions supported by RBAC for Applications by running the Get-ManagementRole cmdlet:
Get-ManagementRole | Where-Object {$_.Name -like "Application *"}The New-ManagementRoleAssignment cmdlet creates the assignment to link the components together. In this example, you can see how the application identifier, permission, and management scope are specified:
New-ManagementRoleAssignment -App $SP.AppId -Role "Application Mail.Send" -CustomResourceScope "Azure Management Account"
The assignment is effective immediately. Assuming no errors, the application should now be able to send email from any of the mailboxes identified in the management scope without consent being granted for the Mail.Send permission.
Administrative Unit Support
Our example management scope uses a recipient filter to find the set of mailboxes available to the app. RBAC for Applications also supports the use of Entra ID administrative units to define the sets of resources made available through management scopes and role assignments.
A Simple Fix for Misuse of the Mail.Send Permission
Like anything else, RBAC for Applications takes a little getting used to, but it’s really quite straightforward. App, scope, and assignment combine to make the right permission available to an app for limited Exchange Online resources. That’s so much better than allowing apps to have free rein over mailbox contents. Your CEO might just agree as I’m sure they don’t fancy apps sending mail on their behalf.
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.
Programmatically get edge ids from geometry of femodel
I am using matlab’s pde toolbox and setup a geometry for femodel like this:
% Source – https://stackoverflow.com/q/79888928
% Posted by MiB_Coder
% Retrieved 2026-02-16, License – CC BY-SA 4.0
gd = [3 4 0 1 1 0 0 0 1 1]’; % Example: A simple square
sf = ‘S1’;
ns = (‘S1′)’;
[g,bt] = decsg(gd, sf, ns)
fe = femodel(AnalysisType="electrostatic", Geometry=g);
fe.PlanarType = "axisymmetric";
figure(1); clf;
pdegplot(fe, ‘EdgeLabels’, ‘on’, ‘FaceLabels’,’on’);
axis equal off;
I can get a diagram indicating which edge-id is assign to an edge:
The resulting geometry does not contain information, which vertices form the edges:
>> fe.Geometry
ans =
fegeometry with properties:
NumFaces: 1
NumEdges: 4
NumVertices: 4
NumCells: 0
Vertices: [4×2 double]
Mesh: []
How can I retrieve which edge id belongs to which vertices in the geometry.
How can I retrieve which edge id is where programmatically?How can I retrieve which edge id is where programmatically?I am using matlab’s pde toolbox and setup a geometry for femodel like this:
% Source – https://stackoverflow.com/q/79888928
% Posted by MiB_Coder
% Retrieved 2026-02-16, License – CC BY-SA 4.0
gd = [3 4 0 1 1 0 0 0 1 1]’; % Example: A simple square
sf = ‘S1’;
ns = (‘S1′)’;
[g,bt] = decsg(gd, sf, ns)
fe = femodel(AnalysisType="electrostatic", Geometry=g);
fe.PlanarType = "axisymmetric";
figure(1); clf;
pdegplot(fe, ‘EdgeLabels’, ‘on’, ‘FaceLabels’,’on’);
axis equal off;
I can get a diagram indicating which edge-id is assign to an edge:
The resulting geometry does not contain information, which vertices form the edges:
>> fe.Geometry
ans =
fegeometry with properties:
NumFaces: 1
NumEdges: 4
NumVertices: 4
NumCells: 0
Vertices: [4×2 double]
Mesh: []
How can I retrieve which edge id belongs to which vertices in the geometry.
How can I retrieve which edge id is where programmatically?How can I retrieve which edge id is where programmatically? I am using matlab’s pde toolbox and setup a geometry for femodel like this:
% Source – https://stackoverflow.com/q/79888928
% Posted by MiB_Coder
% Retrieved 2026-02-16, License – CC BY-SA 4.0
gd = [3 4 0 1 1 0 0 0 1 1]’; % Example: A simple square
sf = ‘S1’;
ns = (‘S1′)’;
[g,bt] = decsg(gd, sf, ns)
fe = femodel(AnalysisType="electrostatic", Geometry=g);
fe.PlanarType = "axisymmetric";
figure(1); clf;
pdegplot(fe, ‘EdgeLabels’, ‘on’, ‘FaceLabels’,’on’);
axis equal off;
I can get a diagram indicating which edge-id is assign to an edge:
The resulting geometry does not contain information, which vertices form the edges:
>> fe.Geometry
ans =
fegeometry with properties:
NumFaces: 1
NumEdges: 4
NumVertices: 4
NumCells: 0
Vertices: [4×2 double]
Mesh: []
How can I retrieve which edge id belongs to which vertices in the geometry.
How can I retrieve which edge id is where programmatically?How can I retrieve which edge id is where programmatically? pde, femodel, edge MATLAB Answers — New Questions
Rough Terrain in Simscape Multibody
I am trying to simulate the navigation of a vehicle over an irregular terrain in Simscape Multibody.
I would like to dynamically modify the terrain height and slope during the simulation.
Is it possible to model a terrain that translates and rotates according to a time-varying input signal, without the terrain applying accelerations or non-physical forces to the bodies in contact with it?I am trying to simulate the navigation of a vehicle over an irregular terrain in Simscape Multibody.
I would like to dynamically modify the terrain height and slope during the simulation.
Is it possible to model a terrain that translates and rotates according to a time-varying input signal, without the terrain applying accelerations or non-physical forces to the bodies in contact with it? I am trying to simulate the navigation of a vehicle over an irregular terrain in Simscape Multibody.
I would like to dynamically modify the terrain height and slope during the simulation.
Is it possible to model a terrain that translates and rotates according to a time-varying input signal, without the terrain applying accelerations or non-physical forces to the bodies in contact with it? simscape MATLAB Answers — New Questions
How to add forced displacement or oscillation into Simscape Multibody?
I’m trying conducting oscillation analysys of multibody dynamics in Simscape Multibody.
In my model, I need to add forced displacement. The figure is an example model that I want to make. In this model, the wall is moving and its displacement is oscillating. I know how to add external force in Simscape Multibody. But what I need is forced displacement like the figure.
The below figure is a model I’m making. In this model, I want to make ‘Base solid’ oscillate without external force.
Please tell me how to add forced displacement.I’m trying conducting oscillation analysys of multibody dynamics in Simscape Multibody.
In my model, I need to add forced displacement. The figure is an example model that I want to make. In this model, the wall is moving and its displacement is oscillating. I know how to add external force in Simscape Multibody. But what I need is forced displacement like the figure.
The below figure is a model I’m making. In this model, I want to make ‘Base solid’ oscillate without external force.
Please tell me how to add forced displacement. I’m trying conducting oscillation analysys of multibody dynamics in Simscape Multibody.
In my model, I need to add forced displacement. The figure is an example model that I want to make. In this model, the wall is moving and its displacement is oscillating. I know how to add external force in Simscape Multibody. But what I need is forced displacement like the figure.
The below figure is a model I’m making. In this model, I want to make ‘Base solid’ oscillate without external force.
Please tell me how to add forced displacement. simscape, multibody MATLAB Answers — New Questions
Exchange Online PowerShell Dumps the Credential Parameter
Old Credential Parameter Gets the Bullet in June 2026
Much as I support the efforts to eradicate single-factor authentication from Microsoft 365, especially for administrative purposes, the February 12, 2026, announcement about the deprecation of the Credential parameter in Exchange Online PowerShell left me cold.
The logic underpinning the announcement is undeniable. Microsoft 365 is gradually turning the screw on administrators to force the adoption of multifactor authentication. The process started a few years ago and has gradually spread over the Microsoft 365, Azure, and Entra administrative interfaces.
Username and Password Credentials
The Credential parameter for the Connect-ExchangeOnline cmdlet accepts a PSCredential object containing the username and password for an account and uses the credentials (Figure 1) to connect to Exchange Online in an authentication flow called Resource Owner Password Credentials (ROPC). Even though ROPC is supported by OAuth, it doesn’t support multifactor authentication and is therefore just about as secure as watching someone manually enter a username and password to run an interactive Exchange Online PowerShell session.

In addition, the Microsoft Authentication Library (MSAL), the component used by applications to acquire access tokens from Entra ID has deprecated ROPC. MSAL is heavily used across Microsoft 365, so when an important component removes support for a capability, it’s time for software that depends on the capability to get rid of it too. And that’s what’s happening here.
I doubt that the change will make any difference to administrators who run interactive sessions with the Exchange Online management module. Their administrative accounts use multifactor authentication (or should) and I can’t see any administrator signing into Exchange Online PowerShell with a credentials object.
Background Jobs Might be Impacted
Where the change could impact operations is in background jobs based on the Exchange Online management module, especially jobs which run scripts written a few years ago and run by the Windows Task Scheduler. I’ve said for years that people should avoid using the Windows Task Scheduler to run jobs. Better and much more secure alternatives exist, like Azure Automation runbooks. Executing Exchange Online runbooks on a schedule managed by Azure Automation is more secure and reliable than any job managed by Task Scheduler.
Some companies continue to insist on banging the drum for the old approach by pumping out example scripts that use Task Scheduler. I suspect that they do this because Task Scheduler is easier for people to set up and configure. Azure Automation is more complex, but it’s like driving a car: two months after you start using Azure Automation to run Exchange Online scripts, you’ll wonder why you thought it so complicated when you started.
Cost is the other fear I hear about moving work to Azure Automation. It’s true that Azure Automation requires a paid Azure subscription with a valid credit card, but the free tier offers 500 minutes of job run time per month. You can run a lot of scripts in 500 minutes, and the cost thereafter is $0.002/minute.
Change and Opportunity
Change brings opportunity, or so it’s said. In this case, the change is the removal of an old parameter that’s well past its best-by date and the opportunity is to find and revamp scripts that use the soon-to-be-deprecated parameter. Move to a more secure form of authentication (the gold standard for unattended jobs is Azure Automation with managed identities) and take the chance to review the code to improve its performance and robustness.
The Changeover
Microsoft says that the change is effective in versions of the Exchange Online management PowerShell module released after June 2026. This does not mean that the Credential parameter will stop working on July 1, 2026. It does mean that if you update to a new version of the module after June 2026, you can expect to find the parameter is missing. It also means that at some time in the future Microsoft will remove the server-side code that processes the ROPC authentication flow for Exchange Online. At this point, the parameter will cease working even if you use an older version of the module where the parameter is still available.
With so much goodness flowing from the deprecation of an old and insecure component, why I am unhappy? The simple reason is that I’d prefer if the developers working on Microsoft 365 PowerShell modules dedicated their time to resolve the infuriating assembly clashes between Exchange Online, Teams, and the Microsoft Graph PowerShell SDK. I guess that goal doesn’t count as high as elimination of old components and the subsequent reduction of engineering costs. Oh well…
Where is the Save icon (not Save As) in a figure (.fig) R2025b Matlab
Only see Save As and cannot find where Save icon is.Only see Save As and cannot find where Save icon is. Only see Save As and cannot find where Save icon is. save a figure MATLAB Answers — New Questions
How to port the ZCU208 reference design to a custom ZU48DR-based board
I am currently working with a MathWorks reference example and we were able to run this example on the ZCU208 evaluation board, and it works correctly on that platform.
However, we now need to run the same example on our custom hardware board, which is based on a Zynq UltraScale+ RFSOC (ZU48DR) device.
We would like to understand whether it is possible to port the ZCU208 reference design to a custom ZU48DR-based board.
We attempted to create a custom board using the workflow described in the MathWorks documentation:
https://in.mathworks.com/help/soc/ug/create-board-support-framework.html
However, at the very first step, MATLAB reports that there is no available RFSOC board support. It says Only the following boards are supported – Zynq-7000 SoC and Zynq UltraScale+ MPSoC. There is no option available for Zynq UltraScale+ RFSOC.
Could you please clarify if MATLAB currently provides official support for creating custom RFSoC boards? and Is there a recommended method to port the ZCU208 reference workflow to a custom ZU48DR board?
Additionally, we observed that when running the workflow on a ZCU111 board, the rftool configures the clocks(for CLK 104 board) and initializes the RFDC IP.
Is it possible for us to gain access to or enable rftool functionality when using custom RFSOC board?I am currently working with a MathWorks reference example and we were able to run this example on the ZCU208 evaluation board, and it works correctly on that platform.
However, we now need to run the same example on our custom hardware board, which is based on a Zynq UltraScale+ RFSOC (ZU48DR) device.
We would like to understand whether it is possible to port the ZCU208 reference design to a custom ZU48DR-based board.
We attempted to create a custom board using the workflow described in the MathWorks documentation:
https://in.mathworks.com/help/soc/ug/create-board-support-framework.html
However, at the very first step, MATLAB reports that there is no available RFSOC board support. It says Only the following boards are supported – Zynq-7000 SoC and Zynq UltraScale+ MPSoC. There is no option available for Zynq UltraScale+ RFSOC.
Could you please clarify if MATLAB currently provides official support for creating custom RFSoC boards? and Is there a recommended method to port the ZCU208 reference workflow to a custom ZU48DR board?
Additionally, we observed that when running the workflow on a ZCU111 board, the rftool configures the clocks(for CLK 104 board) and initializes the RFDC IP.
Is it possible for us to gain access to or enable rftool functionality when using custom RFSOC board? I am currently working with a MathWorks reference example and we were able to run this example on the ZCU208 evaluation board, and it works correctly on that platform.
However, we now need to run the same example on our custom hardware board, which is based on a Zynq UltraScale+ RFSOC (ZU48DR) device.
We would like to understand whether it is possible to port the ZCU208 reference design to a custom ZU48DR-based board.
We attempted to create a custom board using the workflow described in the MathWorks documentation:
https://in.mathworks.com/help/soc/ug/create-board-support-framework.html
However, at the very first step, MATLAB reports that there is no available RFSOC board support. It says Only the following boards are supported – Zynq-7000 SoC and Zynq UltraScale+ MPSoC. There is no option available for Zynq UltraScale+ RFSOC.
Could you please clarify if MATLAB currently provides official support for creating custom RFSoC boards? and Is there a recommended method to port the ZCU208 reference workflow to a custom ZU48DR board?
Additionally, we observed that when running the workflow on a ZCU111 board, the rftool configures the clocks(for CLK 104 board) and initializes the RFDC IP.
Is it possible for us to gain access to or enable rftool functionality when using custom RFSOC board? custom zu48dr-based board MATLAB Answers — New Questions
Verification code not receiving from matlab while creating new account using MY BITS Gmail account
verification code from mathworks matlab not getting while creating new account using MY BITS Gmail accountverification code from mathworks matlab not getting while creating new account using MY BITS Gmail account verification code from mathworks matlab not getting while creating new account using MY BITS Gmail account verification code not receiving from matlab MATLAB Answers — New Questions
Unable to get polarbubblechart to show all equal diameter bubbles
I am unable to get "polarbubblechart" to have 3 bubbles all have the same correct size.
All the same size are always are big and unusable. If any one is different the plot is unusable. I need to have all bubbles the same size and controllable. See code below.
What am I missing?
ra = 1
x = pi*ra^2
theta = [0 pi/4 pi/2]
theta = theta.’
rho = [10; 10; 10]
sz = [x x x]
%h.SizeData = sz
h = polarbubblechart(theta,rho,sz)
h.SizeData = sz
ABP = 1
ra = .5
x = pi*ra^2
theta = [0 pi/4 pi/2]
theta = theta.’
rho = [10; 10; 10]
sz = [1 x x]
%h.SizeData = sz
h = polarbubblechart(theta,rho,sz)
h.SizeData = sz
ABP = 1I am unable to get "polarbubblechart" to have 3 bubbles all have the same correct size.
All the same size are always are big and unusable. If any one is different the plot is unusable. I need to have all bubbles the same size and controllable. See code below.
What am I missing?
ra = 1
x = pi*ra^2
theta = [0 pi/4 pi/2]
theta = theta.’
rho = [10; 10; 10]
sz = [x x x]
%h.SizeData = sz
h = polarbubblechart(theta,rho,sz)
h.SizeData = sz
ABP = 1
ra = .5
x = pi*ra^2
theta = [0 pi/4 pi/2]
theta = theta.’
rho = [10; 10; 10]
sz = [1 x x]
%h.SizeData = sz
h = polarbubblechart(theta,rho,sz)
h.SizeData = sz
ABP = 1 I am unable to get "polarbubblechart" to have 3 bubbles all have the same correct size.
All the same size are always are big and unusable. If any one is different the plot is unusable. I need to have all bubbles the same size and controllable. See code below.
What am I missing?
ra = 1
x = pi*ra^2
theta = [0 pi/4 pi/2]
theta = theta.’
rho = [10; 10; 10]
sz = [x x x]
%h.SizeData = sz
h = polarbubblechart(theta,rho,sz)
h.SizeData = sz
ABP = 1
ra = .5
x = pi*ra^2
theta = [0 pi/4 pi/2]
theta = theta.’
rho = [10; 10; 10]
sz = [1 x x]
%h.SizeData = sz
h = polarbubblechart(theta,rho,sz)
h.SizeData = sz
ABP = 1 polarbubblechart, size MATLAB Answers — New Questions
Exporting a live script as a pdf renders tables with an inconsistent format
Hi everyone,
I’m trying to export a live script to a PDF for one of my assignments, but the format of tables that MATLAB renders is inconsistent. With some tables, each numerical value is displayed on one line, while with others, the last digit of the number is split on a second line within the cell. In both cases, the table does not fill the entire page space. I see that I can adjust the column widths manually in the live script, but I was wondering if there is a more succinct way to render the tables so that the numbers are not split across multiple lines.
Attached are screenshots of the correct and incorrectly formatted tables, as well as my export settings.
Any help is appreciated.Hi everyone,
I’m trying to export a live script to a PDF for one of my assignments, but the format of tables that MATLAB renders is inconsistent. With some tables, each numerical value is displayed on one line, while with others, the last digit of the number is split on a second line within the cell. In both cases, the table does not fill the entire page space. I see that I can adjust the column widths manually in the live script, but I was wondering if there is a more succinct way to render the tables so that the numbers are not split across multiple lines.
Attached are screenshots of the correct and incorrectly formatted tables, as well as my export settings.
Any help is appreciated. Hi everyone,
I’m trying to export a live script to a PDF for one of my assignments, but the format of tables that MATLAB renders is inconsistent. With some tables, each numerical value is displayed on one line, while with others, the last digit of the number is split on a second line within the cell. In both cases, the table does not fill the entire page space. I see that I can adjust the column widths manually in the live script, but I was wondering if there is a more succinct way to render the tables so that the numbers are not split across multiple lines.
Attached are screenshots of the correct and incorrectly formatted tables, as well as my export settings.
Any help is appreciated. live script, table, linux, pdf, formatting, rendering, export MATLAB Answers — New Questions
How do I include a header file in MATLAB code?
I’m quite new to MATLAB and I’m trying to make a header file and include it in my MATLAB code. The header file contains a lot of constants and calculations that would be needed in the main code. I’m not sure first of all though how to save the header file, (should it be .m?) and also what’s the line of code needed to include it in a MATLAB code. I’m only getting answers for including C/C++ header files in MATLAB.
Apologies if this is a really basic question!I’m quite new to MATLAB and I’m trying to make a header file and include it in my MATLAB code. The header file contains a lot of constants and calculations that would be needed in the main code. I’m not sure first of all though how to save the header file, (should it be .m?) and also what’s the line of code needed to include it in a MATLAB code. I’m only getting answers for including C/C++ header files in MATLAB.
Apologies if this is a really basic question! I’m quite new to MATLAB and I’m trying to make a header file and include it in my MATLAB code. The header file contains a lot of constants and calculations that would be needed in the main code. I’m not sure first of all though how to save the header file, (should it be .m?) and also what’s the line of code needed to include it in a MATLAB code. I’m only getting answers for including C/C++ header files in MATLAB.
Apologies if this is a really basic question! header files, matlab, extension MATLAB Answers — New Questions
Reliably resize uifigure – sometimes set Position is ignored under test automation
Hi,
I’m facing a strange issue, where resizing of a uifigure doesn’t work consistently under testautomation stress.
Maybe someone has a tip for me, is there a better way to ensure that fig.Postion = [something] is visually applied, than drawnow/pause?
I have set of complicated dialogs, where frames needs to be extended to accomodate additional controls, when user clicks something. Everything works OK for manual testing, but starts failing on test automation.
I have a class object, representing the dialog, and it has property "mainFigure" – uifigure. For resizing of it (extra space on the lower part) I’ve implemented method
function pos = increaseMainFigureHeight(obj, increase)
pos = obj.mainFigure.Position;
% move bottom
pos(2) = pos(2) – increase;
% and increase the height
pos(4) = pos(4) + increase;
obj.mainFigure.Position = pos; <<<
% Flush callbacks and allow layout/window to settle before asserting position
desiredPos = pos;
for k = 1:60
drawnow;
if isequal(obj.mainFigure.Position, desiredPos) <<<<< this read may return different value!
disp([‘increase ok: ‘ num2str(k)]);
break;
end
pause(0.05);
end
if k>=60
Messaging.debug(‘Figure height update not solved in 60 rounds’, level=Messaging.Warning);
end
end
And very similar for decrease the height.
Under manual conditions the "disp([‘increase ok: ‘ num2str(k)]);" prints always 1 – after setting new positions and drawnow, reading of the position will correspond to the positions, which were just set!
However, as soon as I get it under testautomation:
classdef ReusableDialogTest < matlab.unittest.TestCase
methods (Test)
function testIncreaseDecreaseMainFigureHeight(testCase)
dlg = dialogs.AIConfigDialog(); % Just create some dialog, inherited from ReusableDialog
clp = onCleanup(@() delete(dlg));
increaseSize = 100;
initialPos = dlg.mainFigure.Position;
extendedPosition = initialPos;
extendedPosition(2) = initialPos(2) – increaseSize;
extendedPosition(4) = initialPos(4) + increaseSize;
for repeat = 1:20
dlg.increaseMainFigureHeight(increaseSize);
testCase.assertEqual(dlg.mainFigure.Position, extendedPosition);
dlg.decreaseMainFigureHeight(increaseSize);
testCase.assertEqual(dlg.mainFigure.Position, initialPos);
end
end
end
end
I’m starting getting problems.
Note: I’ve inserted the loop for 20 repetitions, just to make the issue more visible.
Typical output for running the test will look like:
Running ReusableDialogTest
Setting up ReusableDialogTest
Done setting up ReusableDialogTest in 0 seconds
Running ReusableDialogTest/testIncreaseDecreaseMainFigureHeight
increase ok: 3
decrease ok: 1
increase ok: 2
decrease ok: 1
increase ok: 2
decrease ok: 2
…
So, sometimes several rounds of drawnow/pause are required.
But sometimes it stucks completely. In following case decrease didn’t succeed with 60 hops of drawnow/pause:
Running ReusableDialogTest
Setting up ReusableDialogTest
Done setting up ReusableDialogTest in 0 seconds
Running ReusableDialogTest/testIncreaseDecreaseMainFigureHeight
increase ok: 3
Warning: Figure height update not solved in 60 rounds
================================================================================
Assertion failed in ReusableDialogTest/testIncreaseDecreaseMainFigureHeight and it did not run to completion.
———————
Framework Diagnostic:
———————
assertEqual failed.
–> The numeric values are not equal using "isequaln".
–> Failure table:
Index Actual Expected Error RelativeError
_____ ______ ________ _____ __________________
2 478 578 -100 -0.173010380622837
4 252 152 100 0.657894736842105
Actual Value:
729 478 583 252
Expected Value:
729 578 583 152
——————
Stack Information:Hi,
I’m facing a strange issue, where resizing of a uifigure doesn’t work consistently under testautomation stress.
Maybe someone has a tip for me, is there a better way to ensure that fig.Postion = [something] is visually applied, than drawnow/pause?
I have set of complicated dialogs, where frames needs to be extended to accomodate additional controls, when user clicks something. Everything works OK for manual testing, but starts failing on test automation.
I have a class object, representing the dialog, and it has property "mainFigure" – uifigure. For resizing of it (extra space on the lower part) I’ve implemented method
function pos = increaseMainFigureHeight(obj, increase)
pos = obj.mainFigure.Position;
% move bottom
pos(2) = pos(2) – increase;
% and increase the height
pos(4) = pos(4) + increase;
obj.mainFigure.Position = pos; <<<
% Flush callbacks and allow layout/window to settle before asserting position
desiredPos = pos;
for k = 1:60
drawnow;
if isequal(obj.mainFigure.Position, desiredPos) <<<<< this read may return different value!
disp([‘increase ok: ‘ num2str(k)]);
break;
end
pause(0.05);
end
if k>=60
Messaging.debug(‘Figure height update not solved in 60 rounds’, level=Messaging.Warning);
end
end
And very similar for decrease the height.
Under manual conditions the "disp([‘increase ok: ‘ num2str(k)]);" prints always 1 – after setting new positions and drawnow, reading of the position will correspond to the positions, which were just set!
However, as soon as I get it under testautomation:
classdef ReusableDialogTest < matlab.unittest.TestCase
methods (Test)
function testIncreaseDecreaseMainFigureHeight(testCase)
dlg = dialogs.AIConfigDialog(); % Just create some dialog, inherited from ReusableDialog
clp = onCleanup(@() delete(dlg));
increaseSize = 100;
initialPos = dlg.mainFigure.Position;
extendedPosition = initialPos;
extendedPosition(2) = initialPos(2) – increaseSize;
extendedPosition(4) = initialPos(4) + increaseSize;
for repeat = 1:20
dlg.increaseMainFigureHeight(increaseSize);
testCase.assertEqual(dlg.mainFigure.Position, extendedPosition);
dlg.decreaseMainFigureHeight(increaseSize);
testCase.assertEqual(dlg.mainFigure.Position, initialPos);
end
end
end
end
I’m starting getting problems.
Note: I’ve inserted the loop for 20 repetitions, just to make the issue more visible.
Typical output for running the test will look like:
Running ReusableDialogTest
Setting up ReusableDialogTest
Done setting up ReusableDialogTest in 0 seconds
Running ReusableDialogTest/testIncreaseDecreaseMainFigureHeight
increase ok: 3
decrease ok: 1
increase ok: 2
decrease ok: 1
increase ok: 2
decrease ok: 2
…
So, sometimes several rounds of drawnow/pause are required.
But sometimes it stucks completely. In following case decrease didn’t succeed with 60 hops of drawnow/pause:
Running ReusableDialogTest
Setting up ReusableDialogTest
Done setting up ReusableDialogTest in 0 seconds
Running ReusableDialogTest/testIncreaseDecreaseMainFigureHeight
increase ok: 3
Warning: Figure height update not solved in 60 rounds
================================================================================
Assertion failed in ReusableDialogTest/testIncreaseDecreaseMainFigureHeight and it did not run to completion.
———————
Framework Diagnostic:
———————
assertEqual failed.
–> The numeric values are not equal using "isequaln".
–> Failure table:
Index Actual Expected Error RelativeError
_____ ______ ________ _____ __________________
2 478 578 -100 -0.173010380622837
4 252 152 100 0.657894736842105
Actual Value:
729 478 583 252
Expected Value:
729 578 583 152
——————
Stack Information: Hi,
I’m facing a strange issue, where resizing of a uifigure doesn’t work consistently under testautomation stress.
Maybe someone has a tip for me, is there a better way to ensure that fig.Postion = [something] is visually applied, than drawnow/pause?
I have set of complicated dialogs, where frames needs to be extended to accomodate additional controls, when user clicks something. Everything works OK for manual testing, but starts failing on test automation.
I have a class object, representing the dialog, and it has property "mainFigure" – uifigure. For resizing of it (extra space on the lower part) I’ve implemented method
function pos = increaseMainFigureHeight(obj, increase)
pos = obj.mainFigure.Position;
% move bottom
pos(2) = pos(2) – increase;
% and increase the height
pos(4) = pos(4) + increase;
obj.mainFigure.Position = pos; <<<
% Flush callbacks and allow layout/window to settle before asserting position
desiredPos = pos;
for k = 1:60
drawnow;
if isequal(obj.mainFigure.Position, desiredPos) <<<<< this read may return different value!
disp([‘increase ok: ‘ num2str(k)]);
break;
end
pause(0.05);
end
if k>=60
Messaging.debug(‘Figure height update not solved in 60 rounds’, level=Messaging.Warning);
end
end
And very similar for decrease the height.
Under manual conditions the "disp([‘increase ok: ‘ num2str(k)]);" prints always 1 – after setting new positions and drawnow, reading of the position will correspond to the positions, which were just set!
However, as soon as I get it under testautomation:
classdef ReusableDialogTest < matlab.unittest.TestCase
methods (Test)
function testIncreaseDecreaseMainFigureHeight(testCase)
dlg = dialogs.AIConfigDialog(); % Just create some dialog, inherited from ReusableDialog
clp = onCleanup(@() delete(dlg));
increaseSize = 100;
initialPos = dlg.mainFigure.Position;
extendedPosition = initialPos;
extendedPosition(2) = initialPos(2) – increaseSize;
extendedPosition(4) = initialPos(4) + increaseSize;
for repeat = 1:20
dlg.increaseMainFigureHeight(increaseSize);
testCase.assertEqual(dlg.mainFigure.Position, extendedPosition);
dlg.decreaseMainFigureHeight(increaseSize);
testCase.assertEqual(dlg.mainFigure.Position, initialPos);
end
end
end
end
I’m starting getting problems.
Note: I’ve inserted the loop for 20 repetitions, just to make the issue more visible.
Typical output for running the test will look like:
Running ReusableDialogTest
Setting up ReusableDialogTest
Done setting up ReusableDialogTest in 0 seconds
Running ReusableDialogTest/testIncreaseDecreaseMainFigureHeight
increase ok: 3
decrease ok: 1
increase ok: 2
decrease ok: 1
increase ok: 2
decrease ok: 2
…
So, sometimes several rounds of drawnow/pause are required.
But sometimes it stucks completely. In following case decrease didn’t succeed with 60 hops of drawnow/pause:
Running ReusableDialogTest
Setting up ReusableDialogTest
Done setting up ReusableDialogTest in 0 seconds
Running ReusableDialogTest/testIncreaseDecreaseMainFigureHeight
increase ok: 3
Warning: Figure height update not solved in 60 rounds
================================================================================
Assertion failed in ReusableDialogTest/testIncreaseDecreaseMainFigureHeight and it did not run to completion.
———————
Framework Diagnostic:
———————
assertEqual failed.
–> The numeric values are not equal using "isequaln".
–> Failure table:
Index Actual Expected Error RelativeError
_____ ______ ________ _____ __________________
2 478 578 -100 -0.173010380622837
4 252 152 100 0.657894736842105
Actual Value:
729 478 583 252
Expected Value:
729 578 583 152
——————
Stack Information: matlab gui, matlab, gui MATLAB Answers — New Questions
USRP B210 GPSDO time?
I am working on a project using both the USRP B210 and the compatible GPSDO. I am time-stamping pulses detected when going through the SDR. Is there a way through either MATLAB or Simulink that I can pull the GPS timestamps from the SDR packets it streams to the PC? I already have the USRP Communications toolbox installed. I have gone through the toolbox documentation and it appears to have no information regarding parsing the packets. The Simulink block appears to only provide the sample of the signal, and not the timestamp of that sample.I am working on a project using both the USRP B210 and the compatible GPSDO. I am time-stamping pulses detected when going through the SDR. Is there a way through either MATLAB or Simulink that I can pull the GPS timestamps from the SDR packets it streams to the PC? I already have the USRP Communications toolbox installed. I have gone through the toolbox documentation and it appears to have no information regarding parsing the packets. The Simulink block appears to only provide the sample of the signal, and not the timestamp of that sample. I am working on a project using both the USRP B210 and the compatible GPSDO. I am time-stamping pulses detected when going through the SDR. Is there a way through either MATLAB or Simulink that I can pull the GPS timestamps from the SDR packets it streams to the PC? I already have the USRP Communications toolbox installed. I have gone through the toolbox documentation and it appears to have no information regarding parsing the packets. The Simulink block appears to only provide the sample of the signal, and not the timestamp of that sample. ettus, usrp, time, gps MATLAB Answers — New Questions
How can I do one-hot encoding in MATLAB?
I would like to perform one-hot encoding on the vector [1 7 10 9 8 6]’ with 10 classes (numbers 1 to 10). The resulting 6×10 matrix should have a 1×10 vector in place of each number, with "1" at the position corresponding to the number and "0" at all other positions.I would like to perform one-hot encoding on the vector [1 7 10 9 8 6]’ with 10 classes (numbers 1 to 10). The resulting 6×10 matrix should have a 1×10 vector in place of each number, with "1" at the position corresponding to the number and "0" at all other positions. I would like to perform one-hot encoding on the vector [1 7 10 9 8 6]’ with 10 classes (numbers 1 to 10). The resulting 6×10 matrix should have a 1×10 vector in place of each number, with "1" at the position corresponding to the number and "0" at all other positions. one, hot, encoding, corresponding, number, 1, 0 MATLAB Answers — New Questions
why is my for loop not working?
y=@(x) x^2-4;
x1=input(‘Enter the value of x1:’);
x2=input(‘Enter the value of x2:’);
x3=input(‘Enter the value of x3:’);
for i=1:100
L1=(x2-x3)/(x3-x1);
xf=x3+L1*(x3-x1);
y1=abs(y(x1));
y2= abs(y(x2));
y3=abs(y(x3));
yf=abs(y(xf));
ynext=sort([y1 y2 y3 yf]);
if y1==max(ynext)
x1=xf;
elseif y2==max(ynext)
x2=xf;
else
x3=xf;
end
if y(xf)<10^-10
break
end
end
fprintf(‘the root: %fn the number of iterations: %dn’,xf,i)y=@(x) x^2-4;
x1=input(‘Enter the value of x1:’);
x2=input(‘Enter the value of x2:’);
x3=input(‘Enter the value of x3:’);
for i=1:100
L1=(x2-x3)/(x3-x1);
xf=x3+L1*(x3-x1);
y1=abs(y(x1));
y2= abs(y(x2));
y3=abs(y(x3));
yf=abs(y(xf));
ynext=sort([y1 y2 y3 yf]);
if y1==max(ynext)
x1=xf;
elseif y2==max(ynext)
x2=xf;
else
x3=xf;
end
if y(xf)<10^-10
break
end
end
fprintf(‘the root: %fn the number of iterations: %dn’,xf,i) y=@(x) x^2-4;
x1=input(‘Enter the value of x1:’);
x2=input(‘Enter the value of x2:’);
x3=input(‘Enter the value of x3:’);
for i=1:100
L1=(x2-x3)/(x3-x1);
xf=x3+L1*(x3-x1);
y1=abs(y(x1));
y2= abs(y(x2));
y3=abs(y(x3));
yf=abs(y(xf));
ynext=sort([y1 y2 y3 yf]);
if y1==max(ynext)
x1=xf;
elseif y2==max(ynext)
x2=xf;
else
x3=xf;
end
if y(xf)<10^-10
break
end
end
fprintf(‘the root: %fn the number of iterations: %dn’,xf,i) for loop MATLAB Answers — New Questions
MATLAB 2025b not launching
I recently did a firmware update on my linux machine and after that I am not able to launch MATLAB 2025b.
This is the error I get:
MathWorks Licensing Error 9
A licensing error occurred while trying to use MATLAB.
The host ID ‘843a5b57c8e7’ in the license file does not match your computer’s host ID: c0a810c2b168.
To resolve this issue, reactivate your license.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/9
Details for Support
Feature: MATLAB
License: /home/srikar-k/.matlab/R2025b_licenses:/usr/local/MATLAB/R2025b/licenses/license.dat:/usr/local/MATLAB/R2025b/licenses/license_srikar-k-Dell-Pro-Max-16-Premium-MA16250_41282735_13252145_R2025b.lic
Error Code: -9.2
Unable to launch MVM server: License Error: Licensing shutdownI recently did a firmware update on my linux machine and after that I am not able to launch MATLAB 2025b.
This is the error I get:
MathWorks Licensing Error 9
A licensing error occurred while trying to use MATLAB.
The host ID ‘843a5b57c8e7’ in the license file does not match your computer’s host ID: c0a810c2b168.
To resolve this issue, reactivate your license.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/9
Details for Support
Feature: MATLAB
License: /home/srikar-k/.matlab/R2025b_licenses:/usr/local/MATLAB/R2025b/licenses/license.dat:/usr/local/MATLAB/R2025b/licenses/license_srikar-k-Dell-Pro-Max-16-Premium-MA16250_41282735_13252145_R2025b.lic
Error Code: -9.2
Unable to launch MVM server: License Error: Licensing shutdown I recently did a firmware update on my linux machine and after that I am not able to launch MATLAB 2025b.
This is the error I get:
MathWorks Licensing Error 9
A licensing error occurred while trying to use MATLAB.
The host ID ‘843a5b57c8e7’ in the license file does not match your computer’s host ID: c0a810c2b168.
To resolve this issue, reactivate your license.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/9
Details for Support
Feature: MATLAB
License: /home/srikar-k/.matlab/R2025b_licenses:/usr/local/MATLAB/R2025b/licenses/license.dat:/usr/local/MATLAB/R2025b/licenses/license_srikar-k-Dell-Pro-Max-16-Premium-MA16250_41282735_13252145_R2025b.lic
Error Code: -9.2
Unable to launch MVM server: License Error: Licensing shutdown license MATLAB Answers — New Questions
Code Error Allowed Copilot Chat to Expose Confidential Information
DLP Policy for Copilot Ignored By Software Glitch
An embarrassing security glitch appeared in Microsoft 365 when the DLP policy constructed to stop Copilot Chat processing email and files stamped with specific sensitivity labels failed to suppress confidential material appearing in Copilot responses. According to service health advisory CW1226324 (3 February 2026), the root cause is a “code issue” which allows “items in the Sent Items and Drafts folders to be picked up by Copilot even though confidential labels are set in place.” Items in other folders don’t appear to be affected.
Customers first reported the issue on 21 January 2026, so the flaw was active for a while before Microsoft accepted that the problem was real.
How the DLP Policy for Copilot Works
Figure 1 shows a DLP policy rule of the type affected by the problem. The rule mandates that any email or document (Office or PDF files) stamped with the Confidential label is excluded from Copilot for Microsoft 365 processing.

With the DLP Policy for Copilot in place, I created and sent a message stamped with the Confidential label. The message refers to a fictious Project Bunny. When I asked Copilot Chat to search for information about Project Bunny, Copilot responded that it could find an internal reference (the email) but cannot disclose the content because it is marked as sensitive internal correspondence (i.e., the sensitivity label).

Problem Fix Rolling Out
According to CW1226324, my tenant was affected. I didn’t notice the problem until it was drawn to my attention by a comment posted to Office365ITPros.com. By the time I tested, Microsoft had fixed the problem, and the fix had reached my tenant. According to an update posted on 10 February 2026, the remediation for the issue is rolling out. Or, in Microsoft terms, “saturates across the affected environments,” which is how they describe a software update reaching all the servers that need to be patched.
Microsoft promises to provide a follow-up update about the issue on 18 February 2026. If, as it seems, the problem is fixed, Microsoft might proceed to generate a post-incident report (PIR) to explain what happened. It would be interesting to know if the code issue has always existed or was introduced as the result of some change.
Software Problems Happen
Everyone working in IT realizes the potential for software issues to occur. But problems like this raise the question about how Microsoft tests software before release. Confidential messages do end up in the Sent Items folder, so on the surface it seems like checking email in that folder is an easy test for the DLP Policy for Copilot. It can be argued that Copilot Chat exposing messages in the Draft folder is less important because these items are personal to the signed-in user and haven’t been shared with other people. Nevertheless, a policy is a policy, and Copilot should not violate the DLP policy.
A Good Reminder
On the upside, the incident serves as a useful reminder to the Microsoft 365 tenants that support the 15 million paid seats for Microsoft 365 Copilot that confidential information should be protected from AI tools. The DLP policy for Copilot should be used in all of these tenants, as should Restricted Content Discovery (RCD) for SharePoint Online. RCD is a SharePoint Advanced Management feature that is available to every tenant with Microsoft 365 Copilot licenses to remove sites containing sensitive or confidential information from Copilot’s view.
For more information about how the DLP policy for Copilot works, see the Microsoft documentation.
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!
Convert non inlined s-function to inlined with wrapper
Hello!
I’m trying to reproduce the model described in this article: https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147
I’ve created the non inlined model. This model take an array of numbers and multuply by 2 each element.
The core function is the flowing:
static void mdlOutputs(SimStruct *S, int_T tid)
{
InputPtrsType uPtrs = ssGetInputPortSignalPtrs(S, 0);
uint8_T *y = (uint8_T *)ssGetOutputPortSignal(S, 0);
int_T width = ssGetOutputPortWidth(S, 0);
for (int_T i = 0; i < width; i++) {
y[i] = 2 * (*(uint8_T *)uPtrs[i]);
}
}
I’ve make a simple model and compile the *.c file with command:
mex times_two.c
The model is in the Noninlined.zip
Now; with the help of the article (https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147) I’ve created a wrapsfcn.tlc:
%%This code is the TLC file wrapsfcn.tlc that inlines wrapsfcn.c:
%% File : wrapsfcn.tlc
%% Abstract:
%% Example inlined tlc file for S-function wrapsfcn.c
%%
%implements "wrapsfcn" "C"
%% Function: BlockTypeSetup ====================================================
%% Abstract:
%% Create function prototype in model.h as:
%% "extern real_T times_two(real_T u);"
%%
%function BlockTypeSetup(block, system) void
%openfile buffer
extern real_T times_two(real_T u); /* This line is placed in wrapper.h */
%closefile buffer
%<LibCacheFunctionPrototype(buffer)>
%endfunction %% BlockTypeSetup
%% Function: Outputs ===========================================================
%% Abstract:
%% y = times_two( u );
%%
%function Outputs(block, system) Output
/* %<Type> Block: %<Name> */
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
%% PROVIDE THE CALLING STATEMENT FOR "algorithm"
%% The following line is expanded and placed in mdlOutputs within wrapper.c
{
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
for (i = 0; i < %<LibBlockInputSignalWidth(0)>; i++) {
%<y> = times_two(%<u>);
}
}
%endfunction %% Outputs
and the file times_two.c:
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#endif
real_T times_two(real_T u)
{
return(2.0 * u);
}
I’ve made a model (see Inlined.zip) but the Simulink didn’t detect the function real_T times_two(real_T u)
Error in S-function ‘inlined_wrapsfcn/S-Function’: S-Function ‘wrapsfcn’ does not exist
From the article I don’t understand what should be the exact content of the files wrapper.c and wrapper.h. It may be the reason why the inlined model didn’t work.
Could you please explain me that steps I’ve missed?Hello!
I’m trying to reproduce the model described in this article: https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147
I’ve created the non inlined model. This model take an array of numbers and multuply by 2 each element.
The core function is the flowing:
static void mdlOutputs(SimStruct *S, int_T tid)
{
InputPtrsType uPtrs = ssGetInputPortSignalPtrs(S, 0);
uint8_T *y = (uint8_T *)ssGetOutputPortSignal(S, 0);
int_T width = ssGetOutputPortWidth(S, 0);
for (int_T i = 0; i < width; i++) {
y[i] = 2 * (*(uint8_T *)uPtrs[i]);
}
}
I’ve make a simple model and compile the *.c file with command:
mex times_two.c
The model is in the Noninlined.zip
Now; with the help of the article (https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147) I’ve created a wrapsfcn.tlc:
%%This code is the TLC file wrapsfcn.tlc that inlines wrapsfcn.c:
%% File : wrapsfcn.tlc
%% Abstract:
%% Example inlined tlc file for S-function wrapsfcn.c
%%
%implements "wrapsfcn" "C"
%% Function: BlockTypeSetup ====================================================
%% Abstract:
%% Create function prototype in model.h as:
%% "extern real_T times_two(real_T u);"
%%
%function BlockTypeSetup(block, system) void
%openfile buffer
extern real_T times_two(real_T u); /* This line is placed in wrapper.h */
%closefile buffer
%<LibCacheFunctionPrototype(buffer)>
%endfunction %% BlockTypeSetup
%% Function: Outputs ===========================================================
%% Abstract:
%% y = times_two( u );
%%
%function Outputs(block, system) Output
/* %<Type> Block: %<Name> */
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
%% PROVIDE THE CALLING STATEMENT FOR "algorithm"
%% The following line is expanded and placed in mdlOutputs within wrapper.c
{
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
for (i = 0; i < %<LibBlockInputSignalWidth(0)>; i++) {
%<y> = times_two(%<u>);
}
}
%endfunction %% Outputs
and the file times_two.c:
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#endif
real_T times_two(real_T u)
{
return(2.0 * u);
}
I’ve made a model (see Inlined.zip) but the Simulink didn’t detect the function real_T times_two(real_T u)
Error in S-function ‘inlined_wrapsfcn/S-Function’: S-Function ‘wrapsfcn’ does not exist
From the article I don’t understand what should be the exact content of the files wrapper.c and wrapper.h. It may be the reason why the inlined model didn’t work.
Could you please explain me that steps I’ve missed? Hello!
I’m trying to reproduce the model described in this article: https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147
I’ve created the non inlined model. This model take an array of numbers and multuply by 2 each element.
The core function is the flowing:
static void mdlOutputs(SimStruct *S, int_T tid)
{
InputPtrsType uPtrs = ssGetInputPortSignalPtrs(S, 0);
uint8_T *y = (uint8_T *)ssGetOutputPortSignal(S, 0);
int_T width = ssGetOutputPortWidth(S, 0);
for (int_T i = 0; i < width; i++) {
y[i] = 2 * (*(uint8_T *)uPtrs[i]);
}
}
I’ve make a simple model and compile the *.c file with command:
mex times_two.c
The model is in the Noninlined.zip
Now; with the help of the article (https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147) I’ve created a wrapsfcn.tlc:
%%This code is the TLC file wrapsfcn.tlc that inlines wrapsfcn.c:
%% File : wrapsfcn.tlc
%% Abstract:
%% Example inlined tlc file for S-function wrapsfcn.c
%%
%implements "wrapsfcn" "C"
%% Function: BlockTypeSetup ====================================================
%% Abstract:
%% Create function prototype in model.h as:
%% "extern real_T times_two(real_T u);"
%%
%function BlockTypeSetup(block, system) void
%openfile buffer
extern real_T times_two(real_T u); /* This line is placed in wrapper.h */
%closefile buffer
%<LibCacheFunctionPrototype(buffer)>
%endfunction %% BlockTypeSetup
%% Function: Outputs ===========================================================
%% Abstract:
%% y = times_two( u );
%%
%function Outputs(block, system) Output
/* %<Type> Block: %<Name> */
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
%% PROVIDE THE CALLING STATEMENT FOR "algorithm"
%% The following line is expanded and placed in mdlOutputs within wrapper.c
{
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
for (i = 0; i < %<LibBlockInputSignalWidth(0)>; i++) {
%<y> = times_two(%<u>);
}
}
%endfunction %% Outputs
and the file times_two.c:
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#endif
real_T times_two(real_T u)
{
return(2.0 * u);
}
I’ve made a model (see Inlined.zip) but the Simulink didn’t detect the function real_T times_two(real_T u)
Error in S-function ‘inlined_wrapsfcn/S-Function’: S-Function ‘wrapsfcn’ does not exist
From the article I don’t understand what should be the exact content of the files wrapper.c and wrapper.h. It may be the reason why the inlined model didn’t work.
Could you please explain me that steps I’ve missed? s-function, mex, tlc, wrapper, inline MATLAB Answers — New Questions
How to TX/RX using 2 boards with the “HW/SW Co-Design QPSK Transmit and Receive Using Analog Devices AD9361/AD9364” example
Hello,
I am trying to transmit and receive using 2 different supported boards (2x ZEDBOARD + 2x FMCOMMS3) using following example:
https://in.mathworks.com/help/soc/ug/hw-sw-co-design-qpsk-transmit-and-receive-using-analog-devices-ad9361-ad9364.html
I have succesfully compiled the simulation, programmed the board via HDL Coder and HDL Workflow Advisor and transmitted and received with ease using one board. However, when trying to use 2 boards, I do not know the procedure I need to follow for a successful TX/RX over air. I am not able to see the other board’s data at the receiver. I do not receive anything.
My approach was the following:
– I configured both ZEDBOARDs with the bitstream of the example.
– I attached one antenna to the TX port of the TX FMCOMMS3 and one antenna to the RX port of the RX FMCOMMS3.
– I disabled on one end the AD936x transmitter system and on the other the AD936x receiver system.
– The systems can be seen in the attached images.
– The UDP receive model was running on the receiver side.
The result: I do not see any bits coming into the RX side.
Anybody has some expertise in this? Maybe there are other examples which I have not discovered yet that address this scenario…
Any help would be welcome. Thank you in advance
—————————————————————————————-
RX Side:
TX side:
UDP Model:Hello,
I am trying to transmit and receive using 2 different supported boards (2x ZEDBOARD + 2x FMCOMMS3) using following example:
https://in.mathworks.com/help/soc/ug/hw-sw-co-design-qpsk-transmit-and-receive-using-analog-devices-ad9361-ad9364.html
I have succesfully compiled the simulation, programmed the board via HDL Coder and HDL Workflow Advisor and transmitted and received with ease using one board. However, when trying to use 2 boards, I do not know the procedure I need to follow for a successful TX/RX over air. I am not able to see the other board’s data at the receiver. I do not receive anything.
My approach was the following:
– I configured both ZEDBOARDs with the bitstream of the example.
– I attached one antenna to the TX port of the TX FMCOMMS3 and one antenna to the RX port of the RX FMCOMMS3.
– I disabled on one end the AD936x transmitter system and on the other the AD936x receiver system.
– The systems can be seen in the attached images.
– The UDP receive model was running on the receiver side.
The result: I do not see any bits coming into the RX side.
Anybody has some expertise in this? Maybe there are other examples which I have not discovered yet that address this scenario…
Any help would be welcome. Thank you in advance
—————————————————————————————-
RX Side:
TX side:
UDP Model: Hello,
I am trying to transmit and receive using 2 different supported boards (2x ZEDBOARD + 2x FMCOMMS3) using following example:
https://in.mathworks.com/help/soc/ug/hw-sw-co-design-qpsk-transmit-and-receive-using-analog-devices-ad9361-ad9364.html
I have succesfully compiled the simulation, programmed the board via HDL Coder and HDL Workflow Advisor and transmitted and received with ease using one board. However, when trying to use 2 boards, I do not know the procedure I need to follow for a successful TX/RX over air. I am not able to see the other board’s data at the receiver. I do not receive anything.
My approach was the following:
– I configured both ZEDBOARDs with the bitstream of the example.
– I attached one antenna to the TX port of the TX FMCOMMS3 and one antenna to the RX port of the RX FMCOMMS3.
– I disabled on one end the AD936x transmitter system and on the other the AD936x receiver system.
– The systems can be seen in the attached images.
– The UDP receive model was running on the receiver side.
The result: I do not see any bits coming into the RX side.
Anybody has some expertise in this? Maybe there are other examples which I have not discovered yet that address this scenario…
Any help would be welcome. Thank you in advance
—————————————————————————————-
RX Side:
TX side:
UDP Model: simulink, ad9361, zedboard, fmcomms3 MATLAB Answers — New Questions
about the use of the fullfact function
I want use the function of fullfact in R2025b, but there is a note that :fullfact needs Statistics and Machine Learning Toolbox。
I installed fullfact Statistics and Machine Learning Toolbox by checking the Add-Ons, but when i check the installation with ver, there is no Statistics and Machine Learning Toolbox,I don’t know why, and how can i use the fullfact.I want use the function of fullfact in R2025b, but there is a note that :fullfact needs Statistics and Machine Learning Toolbox。
I installed fullfact Statistics and Machine Learning Toolbox by checking the Add-Ons, but when i check the installation with ver, there is no Statistics and Machine Learning Toolbox,I don’t know why, and how can i use the fullfact. I want use the function of fullfact in R2025b, but there is a note that :fullfact needs Statistics and Machine Learning Toolbox。
I installed fullfact Statistics and Machine Learning Toolbox by checking the Add-Ons, but when i check the installation with ver, there is no Statistics and Machine Learning Toolbox,I don’t know why, and how can i use the fullfact. fullfact, statistics and machine learning toolbox MATLAB Answers — New Questions









