Month: April 2026
Unable to create ROS2 node
I am trying to create a ROS2 node on Windows 11, MATLAB R2025b.
While either trying to create a node, or even testing with "ros2 node list", I receive an error:
>> node = ros2node("matlab_node");
Error using ros2node/createNode (line 552)
Error creating the ROS 2 node matlab_node.
Error in
ros2node (line 166)
createNode(obj, parser.Results.name, parser.Results.id);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Error using
ros.internal.Node/create
Server failed to start. Details: Transport stopped.
This was working hours ago…
reinstalling ROS toolbox and even MATLAB did not change outcome.
Thanks!I am trying to create a ROS2 node on Windows 11, MATLAB R2025b.
While either trying to create a node, or even testing with "ros2 node list", I receive an error:
>> node = ros2node("matlab_node");
Error using ros2node/createNode (line 552)
Error creating the ROS 2 node matlab_node.
Error in
ros2node (line 166)
createNode(obj, parser.Results.name, parser.Results.id);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Error using
ros.internal.Node/create
Server failed to start. Details: Transport stopped.
This was working hours ago…
reinstalling ROS toolbox and even MATLAB did not change outcome.
Thanks! I am trying to create a ROS2 node on Windows 11, MATLAB R2025b.
While either trying to create a node, or even testing with "ros2 node list", I receive an error:
>> node = ros2node("matlab_node");
Error using ros2node/createNode (line 552)
Error creating the ROS 2 node matlab_node.
Error in
ros2node (line 166)
createNode(obj, parser.Results.name, parser.Results.id);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Error using
ros.internal.Node/create
Server failed to start. Details: Transport stopped.
This was working hours ago…
reinstalling ROS toolbox and even MATLAB did not change outcome.
Thanks! ros2 node list, ros2node MATLAB Answers — New Questions
Writing PowerShell for the Eventually Consistent Entra ID Database
Suggestions for Efficient Transactions Against Entra ID Eventually Consistent Data
An interesting Microsoft development blog post addresses the subject of eventual consistency and how to design applications that use Entra ID data. The blog starts with “To scale reliably and remain resilient during failures, Microsoft Entra uses an eventually consistent directory model.”
The text goes on to explain how transactions happen in the Entra ID multi-region, multi-replica directory architecture. Essentially, transactions happen against local copies of the database and are then synchronized to the other database copies. At this point, the transaction is consistent everywhere across Entra ID and a request to fetch information about the affected object will receive the same information from any instance of Entra ID globally.
The bulk of the post offers suggestions about how application developers should interact with Entra ID. I’ve covered this topic in passing before, but thought it worthwhile to expand on the suggestions made in the blog with some example Microsoft Graph PowerShell SDK code.
Use Delegated Access
The first suggestion is to use delegated access when consistency is required because “delegated access may provide more predictable consistency.” This is easily done by setting the ConsistencyLevel parameter to Eventual in calls to cmdlets that fetch Entra ID data like Get-MgUser, Get-MgGroup, and Get-MgDevice: The CountVariable parameter is also passed to receive the count of objects returned by the request.
[array]$Users = Get-MgUser -Filter "country eq 'Ireland'" -ConsistencyLevel Eventual -All -CountVariable Count
Trust Write Responses
If a write operation (like creating a new group with New-MgGroup or updating a user account with Update-MgUser) doesn’t generate an error, treat the operation as complete. Don’t include the unnecessary overhead of a read to check that the write operation was successful. The PowerShell Try/Catch structure is a good way to detect errors without checking with a follow-up read:
Try {
Update-MgUser -UserId $UserId -JobTitle "Chief Poobah" -ErrorAction Stop
Write-Output "The update worked and the user's title was updated"
} Catch {
Write-Output "The update failed"
}
Use Identifiers Returned for New Objects
Cmdlets that create new Entra ID objects can return a variable containing details of the new object. Use the information from the variable to display details or for further interaction with the new object instead of incurring the additional overhead of reading details from Entra ID (the read might fail if the object isn’t fully synchronized). Here’s an example of creating a new group where the $Group variable is used to receive details of the new group:
Try {
$Group = New-MgGroup -Description "Teams Deployment Project" -DisplayName "Teams deployment project" -MailEnabled:$True -SecurityEnabled:$False -MailNickname "Teams.Deployment.Project" -GroupTypes "Unified" -ErrorAction Stop
Write-Output ("The new team {0} was created with identifier {1}" -f $Group.displayName, $Group.Id)
} Catch {
Write-Output "Sorry... failed to create the new group"
}
Eliminate Multi-Step Workflows
In all cases, avoid code that creates an object, reads the object to check its properties, and then updates the object properties. Instead, create the fully-populated object with a single command. If you’re used to PowerShell splatting, the technique of creating a hash table to hold property values will be second nature. This code populates two hash tables containing the password information and account properties for a new user account processed by New-MgUser to create a new fully-populated user object:
$PasswordProfile = @{}
$PasswordProfile.Add("forceChangePasswordNextSignIn", "true")
$PasswordProfile.Add("password","@TemporaryPassword123!")
$Parameters = @{}
$Parameters.Add("AccountEnabled", "true")
$Parameters.Add("OfficeLocation", "Galway")
$Parameters.Add("Department", "Business Development")
$Parameters.Add("DisplayName", "Carla Jones (BusDev)")
$Parameters.Add("State", "Connacht")
$Parameters.Add("PostalCode", "GY1H1842")
$Parameters.Add("StreetAddress", "Kennedy Center")
$Parameters.Add("City", "Galway")
$Parameters.Add('JobTitle', "Senior Development Manager")
$Parameters.Add("UserPrincipalName", "Carla.Jones@office365itpros.com")
$Parameters.Add("Mail", "Carla.Jones@office365itpros.com")
$Parameters.Add("MailNickName","Carla.Jones")
$Parameters.Add("passwordProfile", $PasswordProfile)
Try {
$NewUser = New-MgUser -BodyParameter $Parameters
Write-Output "New user account created for " $NewUser
} Catch {
Write-Output "Failed to create account"
}
Deal with Transient Read Failures
Because of the eventually consistent nature of Entra ID, it’s possible that a read against a newly created or newly updated object might fail or return a property value that you don’t expect. When this happens, give Entra ID time to synchronize by including some retry logic with exponential backoff.
This is a very simple example that shows the addition of the new user account to the new group created above. The identifiers should be fine because we’re using the values returned by Entra ID, but just in case the addition fails, the catch pauses for five seconds before retrying. In most cases, five seconds should be enough!
Try {
New-MgGroupMember -GroupId $Group.Id -DirectoryObjectId $NewUser.Id -ErrorAction Stop
Write-Output ("User {0} added to group {1}" -f $NewUser.displayName, $Group.DisplayName)
} Catch {
Write-Output "The update didn't work. Pausing for 5 seconds before retry"
Start-Sleep -Seconds 5
New-MgGroupMember -GroupId $Group.Id -DirectoryObjectId $NewUser.Id -ErrorAction Stop
}
Usually, everything just works (Figure 1), but it’s always good to be prepared for a surprise.

Make Retries Idempotent
Simply, make sure that retries that attempt repeated requests don’t end up creating duplicate objects.
None of the advice given in the post is rocket science and I’m sure that people already practice these techniques when working with Entra ID through PowerShell. It’s obviously in Microsoft’s best interests for people to avoid sloppiness in scripts because better code will reduce the demand on the Entra ID service. Following the guidance will also make scripts work better, and that’s never a bad thing.
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.
Deep Learning HDL Workflow “Data size mismatch” after deployment – Possible device tree / AXI DMA configuration issue (ZCU111)
Hello,
I am working with Deep Learning HDL Toolbox on a custom reference design
with the Xilinx ZCU111 RFSoC board. I am able to successfully compile the network,
but I am encountering a deployment error.
Setup: – Board: ZCU111 RFSoC – Interface: PS GEM Ethernet – Reference design:
Custom (based on AXI-Stream DDR Memory Access : 3-AXIM) – Tool versions:
Vivado 2024.1, MATLAB (Deep Learning HDL Toolbox)
Workflow: I compile and deploy the network using: 1. compile(hW) 2.
deploy(hW) 3. predict(…)
Problem: The FPGA is programmed successfully, and the system reboots
correctly: – SSH connection is restored – Ping works
However, during deployment/predict, I get the following error on MATLAB:
Connection to the bitstream is no longer valid caused by error: Data
size mismatch.
Observations: – Bitstream programming is completed successfully – Device
tree is loaded and system boots – The error happens after deployment,
during runtime communication with FPGA.
Device Tree Concern: I suspect that the issue may be related to my device
tree definitions, especially: – dlprocessor IP – AXI stream to
memory-mapped interface (AXIS2AXIM / AXI2SMM) – DMA nodes (MM2S / S2MM)
Possible causes: Incorrect child node definitions
Questions: 1. What are the common causes of “Data size mismatch” in Deep
Learning HDL deployments? 2. Can this error be caused by incorrect
device tree configuration ? 3. Are there specific DTB
requirements for dlprocessor, AXIS2AXIM, and DMA nodes? 4. How can I
verify MATLAB runtime correctly binds to DTB nodes?
Also is there any official or working example of devicetree_dlhdl.dtb for:
Deep Learning HDL Toolbox
AXI-Stream DDR Memory Access (3-AXIM) reference design
ZCU111 (or similar Zynq UltraScale+ platforms)
I am especially interested in correct definitions for:
dlprocessor
AXIS2AXIM / AXI2SMM
DMA nodes (MM2S / S2MM)
mathworks-specific properties (mwipcore, channels, etc.)
If anyone has a working DTB or can point to an example (documentation, repo, or generated output), it would be very helpful.
Thanks!Hello,
I am working with Deep Learning HDL Toolbox on a custom reference design
with the Xilinx ZCU111 RFSoC board. I am able to successfully compile the network,
but I am encountering a deployment error.
Setup: – Board: ZCU111 RFSoC – Interface: PS GEM Ethernet – Reference design:
Custom (based on AXI-Stream DDR Memory Access : 3-AXIM) – Tool versions:
Vivado 2024.1, MATLAB (Deep Learning HDL Toolbox)
Workflow: I compile and deploy the network using: 1. compile(hW) 2.
deploy(hW) 3. predict(…)
Problem: The FPGA is programmed successfully, and the system reboots
correctly: – SSH connection is restored – Ping works
However, during deployment/predict, I get the following error on MATLAB:
Connection to the bitstream is no longer valid caused by error: Data
size mismatch.
Observations: – Bitstream programming is completed successfully – Device
tree is loaded and system boots – The error happens after deployment,
during runtime communication with FPGA.
Device Tree Concern: I suspect that the issue may be related to my device
tree definitions, especially: – dlprocessor IP – AXI stream to
memory-mapped interface (AXIS2AXIM / AXI2SMM) – DMA nodes (MM2S / S2MM)
Possible causes: Incorrect child node definitions
Questions: 1. What are the common causes of “Data size mismatch” in Deep
Learning HDL deployments? 2. Can this error be caused by incorrect
device tree configuration ? 3. Are there specific DTB
requirements for dlprocessor, AXIS2AXIM, and DMA nodes? 4. How can I
verify MATLAB runtime correctly binds to DTB nodes?
Also is there any official or working example of devicetree_dlhdl.dtb for:
Deep Learning HDL Toolbox
AXI-Stream DDR Memory Access (3-AXIM) reference design
ZCU111 (or similar Zynq UltraScale+ platforms)
I am especially interested in correct definitions for:
dlprocessor
AXIS2AXIM / AXI2SMM
DMA nodes (MM2S / S2MM)
mathworks-specific properties (mwipcore, channels, etc.)
If anyone has a working DTB or can point to an example (documentation, repo, or generated output), it would be very helpful.
Thanks! Hello,
I am working with Deep Learning HDL Toolbox on a custom reference design
with the Xilinx ZCU111 RFSoC board. I am able to successfully compile the network,
but I am encountering a deployment error.
Setup: – Board: ZCU111 RFSoC – Interface: PS GEM Ethernet – Reference design:
Custom (based on AXI-Stream DDR Memory Access : 3-AXIM) – Tool versions:
Vivado 2024.1, MATLAB (Deep Learning HDL Toolbox)
Workflow: I compile and deploy the network using: 1. compile(hW) 2.
deploy(hW) 3. predict(…)
Problem: The FPGA is programmed successfully, and the system reboots
correctly: – SSH connection is restored – Ping works
However, during deployment/predict, I get the following error on MATLAB:
Connection to the bitstream is no longer valid caused by error: Data
size mismatch.
Observations: – Bitstream programming is completed successfully – Device
tree is loaded and system boots – The error happens after deployment,
during runtime communication with FPGA.
Device Tree Concern: I suspect that the issue may be related to my device
tree definitions, especially: – dlprocessor IP – AXI stream to
memory-mapped interface (AXIS2AXIM / AXI2SMM) – DMA nodes (MM2S / S2MM)
Possible causes: Incorrect child node definitions
Questions: 1. What are the common causes of “Data size mismatch” in Deep
Learning HDL deployments? 2. Can this error be caused by incorrect
device tree configuration ? 3. Are there specific DTB
requirements for dlprocessor, AXIS2AXIM, and DMA nodes? 4. How can I
verify MATLAB runtime correctly binds to DTB nodes?
Also is there any official or working example of devicetree_dlhdl.dtb for:
Deep Learning HDL Toolbox
AXI-Stream DDR Memory Access (3-AXIM) reference design
ZCU111 (or similar Zynq UltraScale+ platforms)
I am especially interested in correct definitions for:
dlprocessor
AXIS2AXIM / AXI2SMM
DMA nodes (MM2S / S2MM)
mathworks-specific properties (mwipcore, channels, etc.)
If anyone has a working DTB or can point to an example (documentation, repo, or generated output), it would be very helpful.
Thanks! deep learning, cnn, deep learning hdl toolbox, vivado, zcu111 rfsoc board, fpga MATLAB Answers — New Questions
How to correct the grouping variables in splitapply ?
Hi
Kindly see my attached function. It is a callback function for a switch button
I have already converted both my grouping variables to categorical arrrays, still I am getting the message saying: "A grouping variable must be a vector."
I dont understand what more can be and should be done to the grouping variables.
value = app.Switch.Value;
if strcmpi(value, ‘on’)
weightpercentages = [app.Callingapp.Osmotisk_data.Weight_percent_best_salt_1 app.Callingapp.Osmotisk_data.Weight_percent_best_salt_2];
weightpercentages=categorical(weightpercentages);
Combo=categorical(app.Callingapp.Osmotisk_data.Combinations_of_salts);
[g,id1,id2]=findgroups(Combo, weightpercentages);
hold(app.UIAxes, ‘on’)
splitapply(@(x,y)scatter(app.UIAxes,x,y,’filled’),app.temperature,app.Callingapp.Total_water_activity,g)
legend(app.UIAxes,string(id1) + ", "+string(id2) ,’location’,’northwest’)
xlabel(app.UIAxes,’Temperature’), ylabel(app.UIAxes,’Water activity’)
endHi
Kindly see my attached function. It is a callback function for a switch button
I have already converted both my grouping variables to categorical arrrays, still I am getting the message saying: "A grouping variable must be a vector."
I dont understand what more can be and should be done to the grouping variables.
value = app.Switch.Value;
if strcmpi(value, ‘on’)
weightpercentages = [app.Callingapp.Osmotisk_data.Weight_percent_best_salt_1 app.Callingapp.Osmotisk_data.Weight_percent_best_salt_2];
weightpercentages=categorical(weightpercentages);
Combo=categorical(app.Callingapp.Osmotisk_data.Combinations_of_salts);
[g,id1,id2]=findgroups(Combo, weightpercentages);
hold(app.UIAxes, ‘on’)
splitapply(@(x,y)scatter(app.UIAxes,x,y,’filled’),app.temperature,app.Callingapp.Total_water_activity,g)
legend(app.UIAxes,string(id1) + ", "+string(id2) ,’location’,’northwest’)
xlabel(app.UIAxes,’Temperature’), ylabel(app.UIAxes,’Water activity’)
end Hi
Kindly see my attached function. It is a callback function for a switch button
I have already converted both my grouping variables to categorical arrrays, still I am getting the message saying: "A grouping variable must be a vector."
I dont understand what more can be and should be done to the grouping variables.
value = app.Switch.Value;
if strcmpi(value, ‘on’)
weightpercentages = [app.Callingapp.Osmotisk_data.Weight_percent_best_salt_1 app.Callingapp.Osmotisk_data.Weight_percent_best_salt_2];
weightpercentages=categorical(weightpercentages);
Combo=categorical(app.Callingapp.Osmotisk_data.Combinations_of_salts);
[g,id1,id2]=findgroups(Combo, weightpercentages);
hold(app.UIAxes, ‘on’)
splitapply(@(x,y)scatter(app.UIAxes,x,y,’filled’),app.temperature,app.Callingapp.Total_water_activity,g)
legend(app.UIAxes,string(id1) + ", "+string(id2) ,’location’,’northwest’)
xlabel(app.UIAxes,’Temperature’), ylabel(app.UIAxes,’Water activity’)
end splitapply, matlab, groupingvariables MATLAB Answers — New Questions
Want to know the output format of audioread of .wav file captured by hydrophone
Geospectrum M36-600 with porpoise datalogger was used to capture noise. The code and respective output are given below. I want to know what is the output format of audioread? Is it normalized or volts or Pa?
CODE:
info = audioinfo(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’);
disp(info)
[y,Fs] = audioread(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’); % default: scaled floating-point
[yN,FsN] = audioread(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’,"native"); % native format when available
class(y)
min(y)
max(y)
OUTPUT:
class(yN)NoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’
CompressionMethod: ‘Uncompressed’
NumChannels: 1
SampleRate: 32000
TotalSamples: 129024
Duration: 4.0320
Title: []
Comment: []
Artist: []
BitsPerSample: 16
ans = ‘double’
ans = -1.5259e-04
ans = 1.5259e-04
ans = ‘int16’Geospectrum M36-600 with porpoise datalogger was used to capture noise. The code and respective output are given below. I want to know what is the output format of audioread? Is it normalized or volts or Pa?
CODE:
info = audioinfo(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’);
disp(info)
[y,Fs] = audioread(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’); % default: scaled floating-point
[yN,FsN] = audioread(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’,"native"); % native format when available
class(y)
min(y)
max(y)
OUTPUT:
class(yN)NoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’
CompressionMethod: ‘Uncompressed’
NumChannels: 1
SampleRate: 32000
TotalSamples: 129024
Duration: 4.0320
Title: []
Comment: []
Artist: []
BitsPerSample: 16
ans = ‘double’
ans = -1.5259e-04
ans = 1.5259e-04
ans = ‘int16’ Geospectrum M36-600 with porpoise datalogger was used to capture noise. The code and respective output are given below. I want to know what is the output format of audioread? Is it normalized or volts or Pa?
CODE:
info = audioinfo(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’);
disp(info)
[y,Fs] = audioread(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’); % default: scaled floating-point
[yN,FsN] = audioread(‘D:NIOTDSMmatlab codeNoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’,"native"); % native format when available
class(y)
min(y)
max(y)
OUTPUT:
class(yN)NoiseMatlab PC4.06.2025 HydrophoneVFDNear Motor20250604154138 199-203s.wav’
CompressionMethod: ‘Uncompressed’
NumChannels: 1
SampleRate: 32000
TotalSamples: 129024
Duration: 4.0320
Title: []
Comment: []
Artist: []
BitsPerSample: 16
ans = ‘double’
ans = -1.5259e-04
ans = 1.5259e-04
ans = ‘int16’ audioread, hydrophone, porpoisedatalogger MATLAB Answers — New Questions
Bidirectional DC-DC Converter crashes during mode transition (charging to discharging) due to infinite di/dt
Hi everyone,
I am building a microgrid model in Simulink and I am hitting a brick wall during a specific weather transient event.
The Setup:
I have a 48V battery connected to a 200V DC Bus via a Bidirectional DC-DC Converter.
The DC Bus has a constant 1500W load, supported by Wind and Solar sources.
The converter uses cascaded PI controllers (Outer Voltage Loop, Inner Current Loop) to generate a PWM duty cycle via a Relational Operator and Triangle Wave (10 kHz).
The powergui is set to Discrete with a sample time of 1e-5.
The Problem:For the first 14.9 seconds, the Wind and Solar easily supply the load, and the excess power is pushed into the battery. The battery is charging (current is flowing in reverse).
At exactly t = 15.0 seconds, the wind and solar drop. The battery must instantly reverse current flow to discharge and support the 1500W load. At this exact millisecond, the simulation aborts. Scopes show a massive, instantaneous current spike as the current tries to reverse direction, causing the math solver to fail.
What I Have Already Tried:
Swapped to modern Discrete PID blocks with Anti-Windup (Clamping) to prevent integrator explosion.
Lowered the PI gains significantly to stop the controller from aggressively overreacting.
Disabled zero-crossing detection on the PID blocks.
Capped the maximum Duty Cycle at 0.85 to prevent infinite voltage commands.
I have attached a screenshot of my control loop and the scope showing the crash at 15.0s. Any advice or guidance on power electronics best practices in Simulink would be greatly appreciated!Hi everyone,
I am building a microgrid model in Simulink and I am hitting a brick wall during a specific weather transient event.
The Setup:
I have a 48V battery connected to a 200V DC Bus via a Bidirectional DC-DC Converter.
The DC Bus has a constant 1500W load, supported by Wind and Solar sources.
The converter uses cascaded PI controllers (Outer Voltage Loop, Inner Current Loop) to generate a PWM duty cycle via a Relational Operator and Triangle Wave (10 kHz).
The powergui is set to Discrete with a sample time of 1e-5.
The Problem:For the first 14.9 seconds, the Wind and Solar easily supply the load, and the excess power is pushed into the battery. The battery is charging (current is flowing in reverse).
At exactly t = 15.0 seconds, the wind and solar drop. The battery must instantly reverse current flow to discharge and support the 1500W load. At this exact millisecond, the simulation aborts. Scopes show a massive, instantaneous current spike as the current tries to reverse direction, causing the math solver to fail.
What I Have Already Tried:
Swapped to modern Discrete PID blocks with Anti-Windup (Clamping) to prevent integrator explosion.
Lowered the PI gains significantly to stop the controller from aggressively overreacting.
Disabled zero-crossing detection on the PID blocks.
Capped the maximum Duty Cycle at 0.85 to prevent infinite voltage commands.
I have attached a screenshot of my control loop and the scope showing the crash at 15.0s. Any advice or guidance on power electronics best practices in Simulink would be greatly appreciated! Hi everyone,
I am building a microgrid model in Simulink and I am hitting a brick wall during a specific weather transient event.
The Setup:
I have a 48V battery connected to a 200V DC Bus via a Bidirectional DC-DC Converter.
The DC Bus has a constant 1500W load, supported by Wind and Solar sources.
The converter uses cascaded PI controllers (Outer Voltage Loop, Inner Current Loop) to generate a PWM duty cycle via a Relational Operator and Triangle Wave (10 kHz).
The powergui is set to Discrete with a sample time of 1e-5.
The Problem:For the first 14.9 seconds, the Wind and Solar easily supply the load, and the excess power is pushed into the battery. The battery is charging (current is flowing in reverse).
At exactly t = 15.0 seconds, the wind and solar drop. The battery must instantly reverse current flow to discharge and support the 1500W load. At this exact millisecond, the simulation aborts. Scopes show a massive, instantaneous current spike as the current tries to reverse direction, causing the math solver to fail.
What I Have Already Tried:
Swapped to modern Discrete PID blocks with Anti-Windup (Clamping) to prevent integrator explosion.
Lowered the PI gains significantly to stop the controller from aggressively overreacting.
Disabled zero-crossing detection on the PID blocks.
Capped the maximum Duty Cycle at 0.85 to prevent infinite voltage commands.
I have attached a screenshot of my control loop and the scope showing the crash at 15.0s. Any advice or guidance on power electronics best practices in Simulink would be greatly appreciated! dc, inverter, crash MATLAB Answers — New Questions
How to add a shared ylabel on the right hand-side of a figure, when combining tiledlayout and yyaxis?
In addition to a shared ylabel on the left hand-side of a figure, I want to put a shared ylabel on the right hand-side of the tiledlayout, when also using yyaxis. How can I achieve this? I have prepared the following MWE:
figure
t = tiledlayout(4,1);
for i = 1:4
nexttile
title("Tile"+i)
yyaxis left
plot(rand(1,10))
yyaxis right
plot(rand(1,10))
end
title(t,"Tiles")
xlabel(t,"x")
ylabel(t,"y left")
% ylabel(t,"y right")
Thanks in advance!
Edit:
My yticklabels on the left as well as on the right hand-side are relatively long, therefore, both shared ylabels need to factor the necessary distance in. The shared ylabel on the left hand-side does this automatically, the one on the right hand-side should do the same. I have updated the MWE (unfortunately, it now acts a bit buggy but it should illustrate the point, nonetheless):
figure
t = tiledlayout(4,1);
longYTickLabels_left = ["negative yticklabel left" "0" "positive yticklabel left" ];%edit: added
longYTickLabels_right = ["negative yticklabel right" "0" "positive yticklabel right"];%edit: added
for i = 1:4
nexttile
title("Tile"+i)
yyaxis left
plot(rand(1,10))
yticklabels(longYTickLabels_left)%edit: added
yyaxis right
plot(rand(1,10))
yticklabels(longYTickLabels_right)%edit: added
end
title(t,"Tiles")
xlabel(t,"x")
ylabel(t,"y left")
% ylabel(t,"y right")In addition to a shared ylabel on the left hand-side of a figure, I want to put a shared ylabel on the right hand-side of the tiledlayout, when also using yyaxis. How can I achieve this? I have prepared the following MWE:
figure
t = tiledlayout(4,1);
for i = 1:4
nexttile
title("Tile"+i)
yyaxis left
plot(rand(1,10))
yyaxis right
plot(rand(1,10))
end
title(t,"Tiles")
xlabel(t,"x")
ylabel(t,"y left")
% ylabel(t,"y right")
Thanks in advance!
Edit:
My yticklabels on the left as well as on the right hand-side are relatively long, therefore, both shared ylabels need to factor the necessary distance in. The shared ylabel on the left hand-side does this automatically, the one on the right hand-side should do the same. I have updated the MWE (unfortunately, it now acts a bit buggy but it should illustrate the point, nonetheless):
figure
t = tiledlayout(4,1);
longYTickLabels_left = ["negative yticklabel left" "0" "positive yticklabel left" ];%edit: added
longYTickLabels_right = ["negative yticklabel right" "0" "positive yticklabel right"];%edit: added
for i = 1:4
nexttile
title("Tile"+i)
yyaxis left
plot(rand(1,10))
yticklabels(longYTickLabels_left)%edit: added
yyaxis right
plot(rand(1,10))
yticklabels(longYTickLabels_right)%edit: added
end
title(t,"Tiles")
xlabel(t,"x")
ylabel(t,"y left")
% ylabel(t,"y right") In addition to a shared ylabel on the left hand-side of a figure, I want to put a shared ylabel on the right hand-side of the tiledlayout, when also using yyaxis. How can I achieve this? I have prepared the following MWE:
figure
t = tiledlayout(4,1);
for i = 1:4
nexttile
title("Tile"+i)
yyaxis left
plot(rand(1,10))
yyaxis right
plot(rand(1,10))
end
title(t,"Tiles")
xlabel(t,"x")
ylabel(t,"y left")
% ylabel(t,"y right")
Thanks in advance!
Edit:
My yticklabels on the left as well as on the right hand-side are relatively long, therefore, both shared ylabels need to factor the necessary distance in. The shared ylabel on the left hand-side does this automatically, the one on the right hand-side should do the same. I have updated the MWE (unfortunately, it now acts a bit buggy but it should illustrate the point, nonetheless):
figure
t = tiledlayout(4,1);
longYTickLabels_left = ["negative yticklabel left" "0" "positive yticklabel left" ];%edit: added
longYTickLabels_right = ["negative yticklabel right" "0" "positive yticklabel right"];%edit: added
for i = 1:4
nexttile
title("Tile"+i)
yyaxis left
plot(rand(1,10))
yticklabels(longYTickLabels_left)%edit: added
yyaxis right
plot(rand(1,10))
yticklabels(longYTickLabels_right)%edit: added
end
title(t,"Tiles")
xlabel(t,"x")
ylabel(t,"y left")
% ylabel(t,"y right") tiledlayout, yyaxis, ylabel, figure MATLAB Answers — New Questions
I am not able to use learn MATLAB in offline
When I open MATLAB R2025b with my Demo license , when I go to home page and Click on ‘Learn MATLAB’ it takes me to browser , and when i try to learn course in browser it is saying it is recommend to use MATLAB software , but i am not finding any way how can i start the course in matlab softwareWhen I open MATLAB R2025b with my Demo license , when I go to home page and Click on ‘Learn MATLAB’ it takes me to browser , and when i try to learn course in browser it is saying it is recommend to use MATLAB software , but i am not finding any way how can i start the course in matlab software When I open MATLAB R2025b with my Demo license , when I go to home page and Click on ‘Learn MATLAB’ it takes me to browser , and when i try to learn course in browser it is saying it is recommend to use MATLAB software , but i am not finding any way how can i start the course in matlab software learn matlab, simulink, onramp MATLAB Answers — New Questions
Matlab App Designer Scatterplot
I want to display scatterplot on my axes but when I push the button to display it It displays an error.
also, any suggestions on plotting waveform and phasor of 8-qam
Thank you for any helpI want to display scatterplot on my axes but when I push the button to display it It displays an error.
also, any suggestions on plotting waveform and phasor of 8-qam
Thank you for any help I want to display scatterplot on my axes but when I push the button to display it It displays an error.
also, any suggestions on plotting waveform and phasor of 8-qam
Thank you for any help scattterplot, uiaxes, appdesigner, axes, ui MATLAB Answers — New Questions
Set MATLAB as default for .m files in Ubuntu without opening an empty editor
According to the previous thread, MATLAB can be made to open .m files by default in Ubuntu by editing the matlab.desktop file (usually in /usr/share/applications) and changing:
Exec=matlab -desktop
to
Exec=matlab -desktop -r "edit %f"
https://uk.mathworks.com/matlabcentral/answers/565784-defautl-to-open-m-files-in-matlab-linux
This has the side effect that opening MATLAB from its icon causes an empty editor window to be open. Can anyone advise how to avoid this? It looks like using X-Ayatana-Desktop-Shortcuts may help, but I cannot figure out how to make just opening the command window the default and opening the editor to happen only if a file is specified.According to the previous thread, MATLAB can be made to open .m files by default in Ubuntu by editing the matlab.desktop file (usually in /usr/share/applications) and changing:
Exec=matlab -desktop
to
Exec=matlab -desktop -r "edit %f"
https://uk.mathworks.com/matlabcentral/answers/565784-defautl-to-open-m-files-in-matlab-linux
This has the side effect that opening MATLAB from its icon causes an empty editor window to be open. Can anyone advise how to avoid this? It looks like using X-Ayatana-Desktop-Shortcuts may help, but I cannot figure out how to make just opening the command window the default and opening the editor to happen only if a file is specified. According to the previous thread, MATLAB can be made to open .m files by default in Ubuntu by editing the matlab.desktop file (usually in /usr/share/applications) and changing:
Exec=matlab -desktop
to
Exec=matlab -desktop -r "edit %f"
https://uk.mathworks.com/matlabcentral/answers/565784-defautl-to-open-m-files-in-matlab-linux
This has the side effect that opening MATLAB from its icon causes an empty editor window to be open. Can anyone advise how to avoid this? It looks like using X-Ayatana-Desktop-Shortcuts may help, but I cannot figure out how to make just opening the command window the default and opening the editor to happen only if a file is specified. linux, ubuntu, x-ayatana-desktop-shortcuts MATLAB Answers — New Questions
How can I : Develop equations to define geometric primitives?
I am trying to develop a code that will define geometric primitives using equations. the shapes to be identified are, square, circle, rectangle and triangle. When i run my programme it seems to detect all shapes as rectangle.I am trying to develop a code that will define geometric primitives using equations. the shapes to be identified are, square, circle, rectangle and triangle. When i run my programme it seems to detect all shapes as rectangle. I am trying to develop a code that will define geometric primitives using equations. the shapes to be identified are, square, circle, rectangle and triangle. When i run my programme it seems to detect all shapes as rectangle. image processing MATLAB Answers — New Questions
Symbolic solve not returning all values
Hello everyone! I am new to MATLAB, and I am trying to use it to solve for some variables in a system of equations (this is for the node-voltage equations of a filter, but that isn’t fully relevant)
syms Va Vi Vhp Vlp Vbp R2 R3 R1 Rf R s C RH RB RL RF Vo
eqn0 = (( (Va-Vi)/R2) + ( (Va-Vbp)/R3) )== 0;
eqn1 = ( ((Va-Vlp)/R1) + ( (Va-Vhp)/Rf) )==0 ;
eqn2 = (-(Vhp/R) -(Vbp*s*C))==0;
eqn3 = (-(Vbp/R) – (Vlp*s*C))==0;
eqn4 = (-Vhp/RH -Vbp/RB -Vlp/RL – Vo/RF==0);
S = solve(eqn1, eqn2, eqn3, eqn0, eqn4)
Va, Vi, Vhp, Vlp, Vbp, and Vo are all "unknowns", while the rest are supposed to be treated as constants. Ideally, I want it to solve for H(s) = (Vo/Vi) .. Or really, I’d prefer to just be able to find out what every term rearranges to (i.e solving for Vbp, Vhp, Vlp, in terms of the other ones).
But when I run "solve", I get as follows.
Va: [2×1 sym]
Vbp: [2×1 sym]
Vhp: [2×1 sym]
Vi: [2×1 sym]
s: [2×1 sym]
Within these solutions are two (? why? is it not linear?.. Im not sure..) different expressions.
% For S.Vbp
ans =
-(Vlp*(RH – (-(RH*(4*RB^2*RF*Vlp + 4*RB^2*RL*Vo – RF*RH*RL*Vlp))/(RF*RL*Vlp))^(1/2)))/(2*RB)
-(Vlp*(RH + (-(RH*(4*RB^2*RF*Vlp + 4*RB^2*RL*Vo – RF*RH*RL*Vlp))/(RF*RL*Vlp))^(1/2)))/(2*RB)
%Besides the fact there’s *two* equations, this is what I want: just a big
%list of rearranged variables. But again: why two equations!
I am new to MATLAB and I do not really have a concept of the nature of linear equations (I haven’t taken linear algebra) besides "you need one for every variable you want to find", so I do not know where this issue may be coming from. Is it because all the other "variables" (constants) are being treated as variables and there aren’t enough equations? I’ve checked my equations with two friends and I am confident there’s nothing wrong with them.
Thanks!Hello everyone! I am new to MATLAB, and I am trying to use it to solve for some variables in a system of equations (this is for the node-voltage equations of a filter, but that isn’t fully relevant)
syms Va Vi Vhp Vlp Vbp R2 R3 R1 Rf R s C RH RB RL RF Vo
eqn0 = (( (Va-Vi)/R2) + ( (Va-Vbp)/R3) )== 0;
eqn1 = ( ((Va-Vlp)/R1) + ( (Va-Vhp)/Rf) )==0 ;
eqn2 = (-(Vhp/R) -(Vbp*s*C))==0;
eqn3 = (-(Vbp/R) – (Vlp*s*C))==0;
eqn4 = (-Vhp/RH -Vbp/RB -Vlp/RL – Vo/RF==0);
S = solve(eqn1, eqn2, eqn3, eqn0, eqn4)
Va, Vi, Vhp, Vlp, Vbp, and Vo are all "unknowns", while the rest are supposed to be treated as constants. Ideally, I want it to solve for H(s) = (Vo/Vi) .. Or really, I’d prefer to just be able to find out what every term rearranges to (i.e solving for Vbp, Vhp, Vlp, in terms of the other ones).
But when I run "solve", I get as follows.
Va: [2×1 sym]
Vbp: [2×1 sym]
Vhp: [2×1 sym]
Vi: [2×1 sym]
s: [2×1 sym]
Within these solutions are two (? why? is it not linear?.. Im not sure..) different expressions.
% For S.Vbp
ans =
-(Vlp*(RH – (-(RH*(4*RB^2*RF*Vlp + 4*RB^2*RL*Vo – RF*RH*RL*Vlp))/(RF*RL*Vlp))^(1/2)))/(2*RB)
-(Vlp*(RH + (-(RH*(4*RB^2*RF*Vlp + 4*RB^2*RL*Vo – RF*RH*RL*Vlp))/(RF*RL*Vlp))^(1/2)))/(2*RB)
%Besides the fact there’s *two* equations, this is what I want: just a big
%list of rearranged variables. But again: why two equations!
I am new to MATLAB and I do not really have a concept of the nature of linear equations (I haven’t taken linear algebra) besides "you need one for every variable you want to find", so I do not know where this issue may be coming from. Is it because all the other "variables" (constants) are being treated as variables and there aren’t enough equations? I’ve checked my equations with two friends and I am confident there’s nothing wrong with them.
Thanks! Hello everyone! I am new to MATLAB, and I am trying to use it to solve for some variables in a system of equations (this is for the node-voltage equations of a filter, but that isn’t fully relevant)
syms Va Vi Vhp Vlp Vbp R2 R3 R1 Rf R s C RH RB RL RF Vo
eqn0 = (( (Va-Vi)/R2) + ( (Va-Vbp)/R3) )== 0;
eqn1 = ( ((Va-Vlp)/R1) + ( (Va-Vhp)/Rf) )==0 ;
eqn2 = (-(Vhp/R) -(Vbp*s*C))==0;
eqn3 = (-(Vbp/R) – (Vlp*s*C))==0;
eqn4 = (-Vhp/RH -Vbp/RB -Vlp/RL – Vo/RF==0);
S = solve(eqn1, eqn2, eqn3, eqn0, eqn4)
Va, Vi, Vhp, Vlp, Vbp, and Vo are all "unknowns", while the rest are supposed to be treated as constants. Ideally, I want it to solve for H(s) = (Vo/Vi) .. Or really, I’d prefer to just be able to find out what every term rearranges to (i.e solving for Vbp, Vhp, Vlp, in terms of the other ones).
But when I run "solve", I get as follows.
Va: [2×1 sym]
Vbp: [2×1 sym]
Vhp: [2×1 sym]
Vi: [2×1 sym]
s: [2×1 sym]
Within these solutions are two (? why? is it not linear?.. Im not sure..) different expressions.
% For S.Vbp
ans =
-(Vlp*(RH – (-(RH*(4*RB^2*RF*Vlp + 4*RB^2*RL*Vo – RF*RH*RL*Vlp))/(RF*RL*Vlp))^(1/2)))/(2*RB)
-(Vlp*(RH + (-(RH*(4*RB^2*RF*Vlp + 4*RB^2*RL*Vo – RF*RH*RL*Vlp))/(RF*RL*Vlp))^(1/2)))/(2*RB)
%Besides the fact there’s *two* equations, this is what I want: just a big
%list of rearranged variables. But again: why two equations!
I am new to MATLAB and I do not really have a concept of the nature of linear equations (I haven’t taken linear algebra) besides "you need one for every variable you want to find", so I do not know where this issue may be coming from. Is it because all the other "variables" (constants) are being treated as variables and there aren’t enough equations? I’ve checked my equations with two friends and I am confident there’s nothing wrong with them.
Thanks! symbolic MATLAB Answers — New Questions
I’d like to run the example that uses the Support Package for Parrot Drones to perform the basic flight operations. What’s the proc
Here is the MATLAB script. The drone is already connected to PC:
p = parrot();
takeoff(p);
pause (2);
land(p);
takeoff(p);
movement_step = 1;
while(movement_step <= 4 && p.BatteryLevel > 10)
moveforward(p, 2);
turn(p, deg2rad(90));
movement_step = movement_step + 1;
end
land(p);
takeoff(p);
move(p, 5, ‘Roll’, deg2rad(4), ‘RotationSpeed’, deg2rad(120));
land(p);
takeoff(p);
move(p, 5, ‘Pitch’, deg2rad(-4), ‘Roll’, deg2rad(4));
land(p);
clear p;Here is the MATLAB script. The drone is already connected to PC:
p = parrot();
takeoff(p);
pause (2);
land(p);
takeoff(p);
movement_step = 1;
while(movement_step <= 4 && p.BatteryLevel > 10)
moveforward(p, 2);
turn(p, deg2rad(90));
movement_step = movement_step + 1;
end
land(p);
takeoff(p);
move(p, 5, ‘Roll’, deg2rad(4), ‘RotationSpeed’, deg2rad(120));
land(p);
takeoff(p);
move(p, 5, ‘Pitch’, deg2rad(-4), ‘Roll’, deg2rad(4));
land(p);
clear p; Here is the MATLAB script. The drone is already connected to PC:
p = parrot();
takeoff(p);
pause (2);
land(p);
takeoff(p);
movement_step = 1;
while(movement_step <= 4 && p.BatteryLevel > 10)
moveforward(p, 2);
turn(p, deg2rad(90));
movement_step = movement_step + 1;
end
land(p);
takeoff(p);
move(p, 5, ‘Roll’, deg2rad(4), ‘RotationSpeed’, deg2rad(120));
land(p);
takeoff(p);
move(p, 5, ‘Pitch’, deg2rad(-4), ‘Roll’, deg2rad(4));
land(p);
clear p; script, matlab MATLAB Answers — New Questions
Good day my good people, how can we plot the classical variables and the main equations under variation of parameters in bvp4c?
And the classical variables are:
The bvp4c code of the problem is:
function sisko5
% Parameter initialization
A = 1;
M = 1;
n = 2;
m = 1;
gamma = 1;
Nt = 1;
Nb = 1;
GrT = 1;
GrC = 2;
Rd = 1;
Sc = 1;
Pr = 1;
Ec = 1;
% Constant calculation
Costant = (m*(2*n – 1) + 1) / (n + 1);
% System of ODE
function dydx = odefun(~, y)
%f = y(1), f’ = y(2), f” = y(3), theta = y(4), theta’ = y(5), phi = y(6), phi’ = y(7)
dydx = zeros(7, 1);
dydx(1) = y(2);
dydx(2) = y(3);
dydx(3) = (-Costant*y(1)*y(3) + m*y(2)^2 – GrT*y(4) – GrC*y(6) + M*y(2))/(A + n*(-y(3))^(n-1));
dydx(4) = y(5);
dydx(5) = (-Costant*y(1)*y(5) – Nb*y(5)*y(7) – Nt*y(5)^2 – Ec*A*y(3)^2 – Ec*(-y(3))^(n+1) – M*Ec*y(2)^2)/((1+4/3*Rd)/Pr);
dydx(6) = y(7);
dydx(7) = -Sc*Costant*y(1)*y(7) – (Nt/Nb)*dydx(5) + gamma*y(6);
end
% Nested function: Boundary conditions
function res = bcfun(ya, yb)
res = zeros(7, 1);
res(1) = ya(2)-1; % y(2) = 1 at eta = 0
res(2) = ya(1); % y(1) = 0 at eta = 0
res(3) = ya(4)-1; % y(4) = 1 at eta = 0
res(4) = Nb*ya(7) + Nt*ya(5); % Boundary condition at eta = 0
res(5) = yb(2); % y(2) = 0 at eta = 10
res(6) = yb(4); % y(4) = 0 at eta = 10
res(7) = yb(6); % y(6) = 0 at eta = 10
end
solinit=bvpinit(linspace(0,10,10),[0 0 0 0 0 0 0]);
sol=bvp4c(@odefun,@bcfun,solinit);
eta=linspace(0,10,100);
y=deval(sol,eta);
plot(eta,y(6,:))
end
Is it possible to do plot under variation of parameter in bvp4c method? It has been a chalenge for me honestly. Can anyone help my good peolple?And the classical variables are:
The bvp4c code of the problem is:
function sisko5
% Parameter initialization
A = 1;
M = 1;
n = 2;
m = 1;
gamma = 1;
Nt = 1;
Nb = 1;
GrT = 1;
GrC = 2;
Rd = 1;
Sc = 1;
Pr = 1;
Ec = 1;
% Constant calculation
Costant = (m*(2*n – 1) + 1) / (n + 1);
% System of ODE
function dydx = odefun(~, y)
%f = y(1), f’ = y(2), f” = y(3), theta = y(4), theta’ = y(5), phi = y(6), phi’ = y(7)
dydx = zeros(7, 1);
dydx(1) = y(2);
dydx(2) = y(3);
dydx(3) = (-Costant*y(1)*y(3) + m*y(2)^2 – GrT*y(4) – GrC*y(6) + M*y(2))/(A + n*(-y(3))^(n-1));
dydx(4) = y(5);
dydx(5) = (-Costant*y(1)*y(5) – Nb*y(5)*y(7) – Nt*y(5)^2 – Ec*A*y(3)^2 – Ec*(-y(3))^(n+1) – M*Ec*y(2)^2)/((1+4/3*Rd)/Pr);
dydx(6) = y(7);
dydx(7) = -Sc*Costant*y(1)*y(7) – (Nt/Nb)*dydx(5) + gamma*y(6);
end
% Nested function: Boundary conditions
function res = bcfun(ya, yb)
res = zeros(7, 1);
res(1) = ya(2)-1; % y(2) = 1 at eta = 0
res(2) = ya(1); % y(1) = 0 at eta = 0
res(3) = ya(4)-1; % y(4) = 1 at eta = 0
res(4) = Nb*ya(7) + Nt*ya(5); % Boundary condition at eta = 0
res(5) = yb(2); % y(2) = 0 at eta = 10
res(6) = yb(4); % y(4) = 0 at eta = 10
res(7) = yb(6); % y(6) = 0 at eta = 10
end
solinit=bvpinit(linspace(0,10,10),[0 0 0 0 0 0 0]);
sol=bvp4c(@odefun,@bcfun,solinit);
eta=linspace(0,10,100);
y=deval(sol,eta);
plot(eta,y(6,:))
end
Is it possible to do plot under variation of parameter in bvp4c method? It has been a chalenge for me honestly. Can anyone help my good peolple? And the classical variables are:
The bvp4c code of the problem is:
function sisko5
% Parameter initialization
A = 1;
M = 1;
n = 2;
m = 1;
gamma = 1;
Nt = 1;
Nb = 1;
GrT = 1;
GrC = 2;
Rd = 1;
Sc = 1;
Pr = 1;
Ec = 1;
% Constant calculation
Costant = (m*(2*n – 1) + 1) / (n + 1);
% System of ODE
function dydx = odefun(~, y)
%f = y(1), f’ = y(2), f” = y(3), theta = y(4), theta’ = y(5), phi = y(6), phi’ = y(7)
dydx = zeros(7, 1);
dydx(1) = y(2);
dydx(2) = y(3);
dydx(3) = (-Costant*y(1)*y(3) + m*y(2)^2 – GrT*y(4) – GrC*y(6) + M*y(2))/(A + n*(-y(3))^(n-1));
dydx(4) = y(5);
dydx(5) = (-Costant*y(1)*y(5) – Nb*y(5)*y(7) – Nt*y(5)^2 – Ec*A*y(3)^2 – Ec*(-y(3))^(n+1) – M*Ec*y(2)^2)/((1+4/3*Rd)/Pr);
dydx(6) = y(7);
dydx(7) = -Sc*Costant*y(1)*y(7) – (Nt/Nb)*dydx(5) + gamma*y(6);
end
% Nested function: Boundary conditions
function res = bcfun(ya, yb)
res = zeros(7, 1);
res(1) = ya(2)-1; % y(2) = 1 at eta = 0
res(2) = ya(1); % y(1) = 0 at eta = 0
res(3) = ya(4)-1; % y(4) = 1 at eta = 0
res(4) = Nb*ya(7) + Nt*ya(5); % Boundary condition at eta = 0
res(5) = yb(2); % y(2) = 0 at eta = 10
res(6) = yb(4); % y(4) = 0 at eta = 10
res(7) = yb(6); % y(6) = 0 at eta = 10
end
solinit=bvpinit(linspace(0,10,10),[0 0 0 0 0 0 0]);
sol=bvp4c(@odefun,@bcfun,solinit);
eta=linspace(0,10,100);
y=deval(sol,eta);
plot(eta,y(6,:))
end
Is it possible to do plot under variation of parameter in bvp4c method? It has been a chalenge for me honestly. Can anyone help my good peolple? bvp4c, fluid dynamics MATLAB Answers — New Questions
Code generation fails with PLCnext Target for Simulink: pxc_plcn_make_rtw_hook error “Unrecognized method, property, or field ‘Identifier’ for class ‘MException'”
I am trying to generate code from a Simulink model using PLCnext Target for Simulink.
The model runs correctly in simulation, but code generation fails during the build process.
The build stops with the following error:
The call to pxc_plcn_make_rtw_hook, during the exit hook generated the following error:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
The build process will terminate as a result.
Caused by:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
This happens when runs “generate code”
Model configuration:
System target file: pxc_plcn.tlc
Template makefile: pxc_plcn.tmf
Generate code only: enabled
Language: C++
The error appears in the pxc_plcn_make_rtw_hook during the exit hook phase.
Is this related to an incompatibility between the PLCnext Target for Simulink and the MATLAB version, or is there a known issue with this hook?I am trying to generate code from a Simulink model using PLCnext Target for Simulink.
The model runs correctly in simulation, but code generation fails during the build process.
The build stops with the following error:
The call to pxc_plcn_make_rtw_hook, during the exit hook generated the following error:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
The build process will terminate as a result.
Caused by:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
This happens when runs “generate code”
Model configuration:
System target file: pxc_plcn.tlc
Template makefile: pxc_plcn.tmf
Generate code only: enabled
Language: C++
The error appears in the pxc_plcn_make_rtw_hook during the exit hook phase.
Is this related to an incompatibility between the PLCnext Target for Simulink and the MATLAB version, or is there a known issue with this hook? I am trying to generate code from a Simulink model using PLCnext Target for Simulink.
The model runs correctly in simulation, but code generation fails during the build process.
The build stops with the following error:
The call to pxc_plcn_make_rtw_hook, during the exit hook generated the following error:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
The build process will terminate as a result.
Caused by:
Unrecognized method, property, or field ‘Identifier’ for class ‘MException’.
This happens when runs “generate code”
Model configuration:
System target file: pxc_plcn.tlc
Template makefile: pxc_plcn.tmf
Generate code only: enabled
Language: C++
The error appears in the pxc_plcn_make_rtw_hook during the exit hook phase.
Is this related to an incompatibility between the PLCnext Target for Simulink and the MATLAB version, or is there a known issue with this hook? simulink, code-generation, plcnext MATLAB Answers — New Questions
How to disable interactions with DonutChart objects?
Hi everyone,
I’m using the donutchart function (which returns a DonutChart object) and I’m looking for a supported way to disable chart interactions—specifically:
Data tips
The export interaction
For conventional plots (for example, line plots, scatter plots), I can usually disable interactions at the axes level. However, for donut charts I haven’t found an approach that reliably disables these interactions on the DonutChart object itself.
If anyone has a method (or knows whether this is currently not configurable for DonutChart), I’d really appreciate guidance.
Thanks a lot!
Best regards,
RalfHi everyone,
I’m using the donutchart function (which returns a DonutChart object) and I’m looking for a supported way to disable chart interactions—specifically:
Data tips
The export interaction
For conventional plots (for example, line plots, scatter plots), I can usually disable interactions at the axes level. However, for donut charts I haven’t found an approach that reliably disables these interactions on the DonutChart object itself.
If anyone has a method (or knows whether this is currently not configurable for DonutChart), I’d really appreciate guidance.
Thanks a lot!
Best regards,
Ralf Hi everyone,
I’m using the donutchart function (which returns a DonutChart object) and I’m looking for a supported way to disable chart interactions—specifically:
Data tips
The export interaction
For conventional plots (for example, line plots, scatter plots), I can usually disable interactions at the axes level. However, for donut charts I haven’t found an approach that reliably disables these interactions on the DonutChart object itself.
If anyone has a method (or knows whether this is currently not configurable for DonutChart), I’d really appreciate guidance.
Thanks a lot!
Best regards,
Ralf donutchart, donut chart MATLAB Answers — New Questions
Leverage User and Group Assignments to Limit User Access to Apps
Consider Using User and Group Assignments for All Tenant-Created Applications
Following up the conversation about deactivating Entra ID applications, it’s worth noting that another method exists to limit the set of people who can use applications. That method is to assign users (or groups) to applications. When assignments are present, only those with assignments can use an application. It’s a good way to secure access to applications like the Microsoft Graph Command Line Tools application used to run interactive Microsoft Graph PowerShell SDK sessions.
Like deactivation, limiting the set of users with access to an application through assignments is a good way to prevent unauthorized use of an application. In the case of suspicious applications that you don’t recognize, creating a set of authorized users will stop malicious use because it’s highly unlikely that an attacker will have assigned access. Controlling access like this should be a checklist item for many of the applications created within tenants. It doesn’t hurt and can stop abuse.
Microsoft documentation explains how to make user and group assignments and doesn’t need to be repeated here. However, the documentation references “an enterprise application” when it discusses assignments. This is possibly done because the Entra admin center manages user and group assignments through the Enterprise applications section. It would be clearer if the documentation said service principal, which exist for both app registrations created by a tenant and multi-tenant applications created by Microsoft and other third parties. User and group assignments can be created for both app registrations and multi-tenant applications.
Adding User and Group Assignments
Take the example of the IdPowerToys application. Figure 1 shows that two users have assignments to use the application. As the note in the Entra admin center says, because these users have assignments, Entra ID automatically includes the application in the set shown in the My Apps screen.

Adding user and group assignments is easily done through the Entra admin center and can be assigned to either individual users or groups (including dynamic groups). There’s no need to add assignments through PowerShell unless you want to control the process programmatically.
The example below shows how to add a user assignment with the New-MgUserAppRoleAssignment cmdlet. In this case, we use the default role (a GUID with all zeros) to grant access. Custom app roles can be created to support granular levels of access, but the default app role is all that is needed to restrict access to an application.
Connect-MgGraph "Application.ReadWrite.All"
$SP = Get-MgServicePrincipal -Filter "displayName eq 'idPowerToys'"
$UserId = (Get-MgUser -UserId Lotte.Vetler@office365itpros.com).Id
$AppRoleId = '00000000-0000-0000-0000-000000000000'
$Params = @{
"PrincipalId" = $UserId
"ResourceId" = $SP.Id
"AppRoleId" = $AppRoleId
}
Try {
$Status = New-MgUserAppRoleAssignment -UserId $UserId -BodyParameter $Params -ErrorAction Stop
Write-Host ("Assignment successful for {0} to {1}" -f $SP.displayName, $Status.PrincipalDisplayName)
} Catch {
Write-Host ("Error adding assignment for {0}" -f $SP.displayName)
}
Adding Group Assignments
Adding individual user assignments is an effective way to grant access to specific people. However, group assignments are more scalable and easier to manage when large numbers of people need access to an application. Group assignments require Entra P1 or P2 licenses.
To make a group assignment, fetch the group identifier and use it in the request body. The assignment is then made by running the New-MgGroupAppRoleAssignment cmdlet:
$GroupId = (Get-MgGroup -Filter "displayname eq 'IT Department Ireland (Dynamic)'").Id
$Params = @{
"PrincipalId" = $GroupId
"ResourceId" = $SP.Id
"AppRoleId" = $AppRoleId
}
New-MgGroupAppRoleAssignment -GroupId $GroupId -BodyParameter $Params
The Get-MgServicePrincipalAppRoleAssignedTo cmdlet retrieves the assignees for an application:
[array]$Assignees = Get-MgServicePrincipalAppRoleAssignedTo -ServicePrincipalId $SP.Id $Assignees | Format-Table CreatedDateTime, PrincipalDisplayName, AppRoleId CreatedDateTime PrincipalDisplayName AppRoleId --------------- -------------------- --------- 14/03/2023 23:07:08 Tony Redmond 00000000-0000-0000-0000-000000000000 17/11/2023 17:16:09 Lotte Vetler (Paris) 00000000-0000-0000-0000-000000000000 17/02/2026 15:01:51 IT Department Ireland (Dynamic) 00000000-0000-0000-0000-000000000000 17/02/2026 14:56:07 Group Creation Control 00000000-0000-0000-0000-000000000000
To remove a user or group assignment, select the assignment and run the Remove-MgServicePrincipalAppRoleAssignedTo cmdlet. For example, to remove the last assignment from the set captured in the $Assignees array (see above):
Remove-MgServicePrincipalAppRoleAssignedTo -AppRoleAssignmentId $Assignees[-1].Id -ServicePrincipalId $SP.Id
Hiding Applications from MyApps
As mentioned above, when a user receives an assignment, Entra ID surfaces the app in the user’s My Apps screen (Figure 2) if the app is a “non-first-party Microsoft Enterprise Application.” In many cases, it doesn’t make sense to highlight apps in the My Apps screen. For example, apps used to run PowerShell scripts based on the Microsoft Graph PowerShell SDK in app-only mode usually cannot be run from My Apps.

The solution is to amend the application properties by adding a tag to instruct Entra ID to hide the app from My Apps. This won’t stop users signing into apps, but it will stop the My Apps screen becoming cluttered with apps that probably shouldn’t be there. To add the tag, fetch the set of existing tags from the service principal and add the HideApp tag if it’s not already there.
[array]$Tags = $SP.Tags
If ("HideApp" -notin $Tags) {
$Tags += "HideApp"
Update-MgServicePrincipal -ServicePrincipalId $SP.Id -Tags $Tags
}
$Tags
WindowsAzureActiveDirectoryIntegratedApp
HideApp
Once the HideApp tag is present for an application, Entra ID won’t include that application in the set it shows in My Apps.
Tenant Guidelines for User and Group Assignments
While it’s nice to have free and easy access to applications, the current state of threat and the way that attackers use Entra applications means that control is necessary. It’s a good idea for tenants to set guidelines for when applications should have user and group assignments. If you don’t control access to all applications, a good case can be made that any application with a high-profile Graph permission like Sites.FullControl.All or Mail.Send should be protected by user and group assignments. Better safe than sorry.
Learn about managing Entra ID apps and the rest of the Microsoft 365 ecosystem by subscribing to the Office 365 for IT Pros eBook. Use our experience to understand what’s important and how best to protect your tenant.
The Open Nature of Microsoft 365 Copilot Diagnostic Logs
Administrators Can Easily View Copilot Diagnostic Logs through Microsoft 365 Admin Center
An interesting and important request posted to the Microsoft 365 Copilot feedback forum raises the issue of administrator access to Copilot prompts. The Copilot section of the Microsoft 365 admin center contains a setting to send diagnostic logs to Microsoft on behalf of individual users (Figure 1).

Microsoft says that the feature “helps Microsoft receive comprehensive diagnostic data to aid in debugging, especially in cases where users may not be able to provide feedback themselves. By providing feedback on behalf of your users, you can help enhance the overall experience of Copilot for your organization by improving the quality and relevance of its responses.”
What’s in the Copilot Diagnostic Logs
Administrator submission of Copilot diagnostic logs involves the collection of diagnostic information generated for one or more users as they interact with Microsoft 365 Copilot through a selected application. For example, selecting Microsoft 365 (Office) captures details of interactions through Copilot Chat (BizChat). You can only select a single application to report, probably on the basis that an issue is likely to be restricted to how Copilot works through one interface.
The logs can capture up to 30 interactions selected from a date range going back a maximum of 30 days. The logs are generated in JSON format. The basic problem is that user prompts are revealed for all to see, including the administrator who generates the logs. Clicking on the link for the log file opens the file in a browser tab. Figure 2 shows the diagnostic information captured when I prompted BizChat to explain why the content of Copilot diagnostic logs is not obfuscated.

The prompt submitted by the user and the responses generated by Copilot are very clear. On the on hand, it’s easy to understand why this should be so. If the content was obfuscated in some manner, it would be harder for support engineers to interpret. On the other hand, the ease of access to what could be highly confidential and sensitive information is troubling.
Keeping AI Interactions Private
Many people have become accustomed to using AI tools to explore concepts, ideas, and feelings. Those interactions might turn into strategic initiatives or address personal questions. They might examine options to solve HR problems or improve business tactics. In short, the Copilot diagnostic logs capture information that people probably don’t want to share with their tenant administrator.
People might reluctantly agree to share the information with Microsoft to debug a problem with Copilot, but the thought that someone in the organization can access Copilot prompts and responses without any oversight is not something that most users will be comfortable with.
The current situation creates problems at many levels, including making sure that user privacy is respected by tenants. Protecting confidential information is a strong point in the argument to use Microsoft 365 Copilot over competitor solutions like the connectors to Microsoft 365 from OpenAI and Anthrophic.
Administrators can use other methods to investigate Copilot interactions, but exporting the Copilot diagnostics log is easier and faster. In addition, as far as I can tell, the Microsoft 365 admin center does not capture an audit record when an administrator exports the Copilot diagnostic log. It’s not good when such an obvious gap in data privacy is revealed.
Protecting User Privacy is Important
Microsoft provides tenants with an option to obfuscate usage report data to stop administrators seeing usage data for individual users by masking user-referenceable data like display names and email addresses. Knowing that someone has sent so many messages or created 43 documents in the last month is not an earthshattering breach of personal information. Even so, Microsoft responded to customer requests to deliver the option to conceal usage data in reports, for both the reports shown in the Microsoft 365 admin center and those generated by the Microsoft Graph usage reports API (including the Copilot usage report API).
Revealing the full gambit of someone’s conversation with Microsoft 365 Copilot to administrator eyes is a much more serious matter. Microsoft needs to fix this loophole fast by blocking administrator access to user prompts and responses. Adding auditing whenever an administrator generates Copilot diagnostic logs wouldn’t go amiss either. Please vote for the feedback item to show your support.
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!
I want to install Matlab 2010b on a new (2026) HP desktop
How do I install an old version of Matlab (2010b I believe) on a brand new HP desktop running Windows 11? I have the original CDs, but not a valid PLP. (personal license passcode). LeoHow do I install an old version of Matlab (2010b I believe) on a brand new HP desktop running Windows 11? I have the original CDs, but not a valid PLP. (personal license passcode). Leo How do I install an old version of Matlab (2010b I believe) on a brand new HP desktop running Windows 11? I have the original CDs, but not a valid PLP. (personal license passcode). Leo install on a new machine MATLAB Answers — New Questions
Running uitests in parallel
I have a large app with many test cases that I would like to be able run in parallel. However the uitest framework functions (type, press etc. ) all fail when run in parallel due to MATLAB:uiautomation:Driver:NoDisplay. Is there a way to set up the parpool to allow this?
I provide an example of this with a simple file selector app that uses uigetfile to select a file. If the file exists then the first line is written to a label in the app, otherwise an error message is written. The testing utilizes the uitest framework function "press" in both tests and it failes due to the error above when run in parallel. When run without parallel processes both tests pass without errors.
(I borrowed the original code base from the example provided in the answer linked below and modified it for this question)
https://www.mathworks.com/matlabcentral/answers/1989568-create-a-test-case-with-uitest-class-using-uigetfile-and-uiputfileI have a large app with many test cases that I would like to be able run in parallel. However the uitest framework functions (type, press etc. ) all fail when run in parallel due to MATLAB:uiautomation:Driver:NoDisplay. Is there a way to set up the parpool to allow this?
I provide an example of this with a simple file selector app that uses uigetfile to select a file. If the file exists then the first line is written to a label in the app, otherwise an error message is written. The testing utilizes the uitest framework function "press" in both tests and it failes due to the error above when run in parallel. When run without parallel processes both tests pass without errors.
(I borrowed the original code base from the example provided in the answer linked below and modified it for this question)
https://www.mathworks.com/matlabcentral/answers/1989568-create-a-test-case-with-uitest-class-using-uigetfile-and-uiputfile I have a large app with many test cases that I would like to be able run in parallel. However the uitest framework functions (type, press etc. ) all fail when run in parallel due to MATLAB:uiautomation:Driver:NoDisplay. Is there a way to set up the parpool to allow this?
I provide an example of this with a simple file selector app that uses uigetfile to select a file. If the file exists then the first line is written to a label in the app, otherwise an error message is written. The testing utilizes the uitest framework function "press" in both tests and it failes due to the error above when run in parallel. When run without parallel processes both tests pass without errors.
(I borrowed the original code base from the example provided in the answer linked below and modified it for this question)
https://www.mathworks.com/matlabcentral/answers/1989568-create-a-test-case-with-uitest-class-using-uigetfile-and-uiputfile parallel computing, uitest, unittest MATLAB Answers — New Questions









