Month: April 2025
Error with addpath in MATLAB Runtime when Using ROS 2 Custom Messages in a Deployed Application
I am developing a MATLAB application that uses ROS 2 and requires custom messages. The code works fine in the MATLAB development environment, but when I compile it using MATLAB Compiler and try to run the deployed application, I encounter the following error:
Error using matlabpath
Modifying the search path is not supported by MATLAB Compiler. Remove functions that modify the search path from your MATLAB code. To make files visible to your deployed application, add the parent folder to your MATLAB session.
Error in path (line 109)
Error in addpath>doPathAddition (line 126)
Error in addpath (line 90)
Error in ros.internal.getEmptyMessage>getCachedMap (line 53)
Error in ros.internal.getEmptyMessage (line 33)
Error in ros.internal.utilities.findMsgDepends (line 17)
Error in ros.internal.utilities.getPathOfDependentDlls (line 16)
Error in ros2publisher/createPublisher (line 460)
Error in ros2publisher (line 267)
How can I properly include the custom ROS 2 messages in a deployed MATLAB application without triggering this error? Is there a way to avoid the dynamic modification of the path or preload the required dependencies before deployment?
Any guidance on handling custom ROS 2 messages in MATLAB Runtime would be greatly appreciated.I am developing a MATLAB application that uses ROS 2 and requires custom messages. The code works fine in the MATLAB development environment, but when I compile it using MATLAB Compiler and try to run the deployed application, I encounter the following error:
Error using matlabpath
Modifying the search path is not supported by MATLAB Compiler. Remove functions that modify the search path from your MATLAB code. To make files visible to your deployed application, add the parent folder to your MATLAB session.
Error in path (line 109)
Error in addpath>doPathAddition (line 126)
Error in addpath (line 90)
Error in ros.internal.getEmptyMessage>getCachedMap (line 53)
Error in ros.internal.getEmptyMessage (line 33)
Error in ros.internal.utilities.findMsgDepends (line 17)
Error in ros.internal.utilities.getPathOfDependentDlls (line 16)
Error in ros2publisher/createPublisher (line 460)
Error in ros2publisher (line 267)
How can I properly include the custom ROS 2 messages in a deployed MATLAB application without triggering this error? Is there a way to avoid the dynamic modification of the path or preload the required dependencies before deployment?
Any guidance on handling custom ROS 2 messages in MATLAB Runtime would be greatly appreciated. I am developing a MATLAB application that uses ROS 2 and requires custom messages. The code works fine in the MATLAB development environment, but when I compile it using MATLAB Compiler and try to run the deployed application, I encounter the following error:
Error using matlabpath
Modifying the search path is not supported by MATLAB Compiler. Remove functions that modify the search path from your MATLAB code. To make files visible to your deployed application, add the parent folder to your MATLAB session.
Error in path (line 109)
Error in addpath>doPathAddition (line 126)
Error in addpath (line 90)
Error in ros.internal.getEmptyMessage>getCachedMap (line 53)
Error in ros.internal.getEmptyMessage (line 33)
Error in ros.internal.utilities.findMsgDepends (line 17)
Error in ros.internal.utilities.getPathOfDependentDlls (line 16)
Error in ros2publisher/createPublisher (line 460)
Error in ros2publisher (line 267)
How can I properly include the custom ROS 2 messages in a deployed MATLAB application without triggering this error? Is there a way to avoid the dynamic modification of the path or preload the required dependencies before deployment?
Any guidance on handling custom ROS 2 messages in MATLAB Runtime would be greatly appreciated. ros2, matlab-runtime, custom-messages, path, error MATLAB Answers — New Questions
finding longest length
Hi ,I have a matrix as follows
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 1 0
0 1 0 1 1 0 1 0 0 1
1 0 0 0 1 0 1 1 0 0
0 0 0 0 1 0 1 0 0 0
0 1 1 1 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
I need the output as follows:
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0
0 1 0 1 0 0 0 0 0 1
1 0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
i.e only the longest length of pixel that touches two opposite boundary.can any body help please?ThanksHi ,I have a matrix as follows
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 1 0
0 1 0 1 1 0 1 0 0 1
1 0 0 0 1 0 1 1 0 0
0 0 0 0 1 0 1 0 0 0
0 1 1 1 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
I need the output as follows:
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0
0 1 0 1 0 0 0 0 0 1
1 0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
i.e only the longest length of pixel that touches two opposite boundary.can any body help please?Thanks Hi ,I have a matrix as follows
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 1 0
0 1 0 1 1 0 1 0 0 1
1 0 0 0 1 0 1 1 0 0
0 0 0 0 1 0 1 0 0 0
0 1 1 1 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
I need the output as follows:
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0
0 1 0 1 0 0 0 0 0 1
1 0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
i.e only the longest length of pixel that touches two opposite boundary.can any body help please?Thanks pixel, lenght MATLAB Answers — New Questions
How to create multiple Fuzzy Inference Systems (FIS) simultaneously without using a for-loop
I am continuously changing my membership function values in my code. I can run a loop and create as many Fuzzy Inference systems(FISs) as I want. But I want to create all of them simultaneously so that I can cut down on the execution time. I looked up the codes of many inbuilt functions like newfis,addvar etc. They support the creation of one FIS at a time. So is there any other way of solving this problem without having to modify the inbuilt functions?
Thanks in advance.I am continuously changing my membership function values in my code. I can run a loop and create as many Fuzzy Inference systems(FISs) as I want. But I want to create all of them simultaneously so that I can cut down on the execution time. I looked up the codes of many inbuilt functions like newfis,addvar etc. They support the creation of one FIS at a time. So is there any other way of solving this problem without having to modify the inbuilt functions?
Thanks in advance. I am continuously changing my membership function values in my code. I can run a loop and create as many Fuzzy Inference systems(FISs) as I want. But I want to create all of them simultaneously so that I can cut down on the execution time. I looked up the codes of many inbuilt functions like newfis,addvar etc. They support the creation of one FIS at a time. So is there any other way of solving this problem without having to modify the inbuilt functions?
Thanks in advance. fuzzy logic MATLAB Answers — New Questions
Average Optical Flow vectors and plot over multiple frames
Hello,
I am trying to get the average optical flow vectors for a whole video (e.g. for a 10 second video). Currently I am using the opticalFlowFarneback method from Estimate optical flow example with the Computer Vision Toolbox (https://www.mathworks.com/help/vision/ref/opticalflowhs.estimateflow.html):
%% Estimating Optical Flow
% This example uses the Farneback Method to to estimate the direction and speed of moving
% cars in the video
% Copyright 2018 The MathWorks, Inc.
%% Read the video into MATLAB
vidReader = VideoReader(‘visiontraffic.avi’);
opticFlow = opticalFlowFarneback;
%% Estimate Optical Flow of each frame
while hasFrame(vidReader)
frameRGB = readFrame(vidReader);
frameGray = rgb2gray(frameRGB);
flow = estimateFlow(opticFlow,frameGray);
imshow(frameRGB)
hold on
% Plot the flow vectors
plot(flow,’DecimationFactor’,[25 25],’ScaleFactor’, 2)
% Find the handle to the quiver object
q = findobj(gca,’type’,’Quiver’);
% Change the color of the arrows to red
q.Color = ‘r’;
drawnow
hold off
end
Although this produces a nice visualization of flow vectors between two frames (see attached image), I need more like an average of flow vectors across all frames of the video. I am quite new to MatLab, I would be super thankful for any feedback how to change abovementioned code.Hello,
I am trying to get the average optical flow vectors for a whole video (e.g. for a 10 second video). Currently I am using the opticalFlowFarneback method from Estimate optical flow example with the Computer Vision Toolbox (https://www.mathworks.com/help/vision/ref/opticalflowhs.estimateflow.html):
%% Estimating Optical Flow
% This example uses the Farneback Method to to estimate the direction and speed of moving
% cars in the video
% Copyright 2018 The MathWorks, Inc.
%% Read the video into MATLAB
vidReader = VideoReader(‘visiontraffic.avi’);
opticFlow = opticalFlowFarneback;
%% Estimate Optical Flow of each frame
while hasFrame(vidReader)
frameRGB = readFrame(vidReader);
frameGray = rgb2gray(frameRGB);
flow = estimateFlow(opticFlow,frameGray);
imshow(frameRGB)
hold on
% Plot the flow vectors
plot(flow,’DecimationFactor’,[25 25],’ScaleFactor’, 2)
% Find the handle to the quiver object
q = findobj(gca,’type’,’Quiver’);
% Change the color of the arrows to red
q.Color = ‘r’;
drawnow
hold off
end
Although this produces a nice visualization of flow vectors between two frames (see attached image), I need more like an average of flow vectors across all frames of the video. I am quite new to MatLab, I would be super thankful for any feedback how to change abovementioned code. Hello,
I am trying to get the average optical flow vectors for a whole video (e.g. for a 10 second video). Currently I am using the opticalFlowFarneback method from Estimate optical flow example with the Computer Vision Toolbox (https://www.mathworks.com/help/vision/ref/opticalflowhs.estimateflow.html):
%% Estimating Optical Flow
% This example uses the Farneback Method to to estimate the direction and speed of moving
% cars in the video
% Copyright 2018 The MathWorks, Inc.
%% Read the video into MATLAB
vidReader = VideoReader(‘visiontraffic.avi’);
opticFlow = opticalFlowFarneback;
%% Estimate Optical Flow of each frame
while hasFrame(vidReader)
frameRGB = readFrame(vidReader);
frameGray = rgb2gray(frameRGB);
flow = estimateFlow(opticFlow,frameGray);
imshow(frameRGB)
hold on
% Plot the flow vectors
plot(flow,’DecimationFactor’,[25 25],’ScaleFactor’, 2)
% Find the handle to the quiver object
q = findobj(gca,’type’,’Quiver’);
% Change the color of the arrows to red
q.Color = ‘r’;
drawnow
hold off
end
Although this produces a nice visualization of flow vectors between two frames (see attached image), I need more like an average of flow vectors across all frames of the video. I am quite new to MatLab, I would be super thankful for any feedback how to change abovementioned code. optical flow, plot, plotting, quiver, video processing, video, vector, vectors MATLAB Answers — New Questions
How to do recursive least square for online parameter estimation
I have stucked in this details for months now
I have constructed my simulink model which is a little complicated (containing a PV array + DC/DC converter ) using simscape
the simulation is working for this first stage
The second stage is to use online parameter estimation to estimate the time varying parameter of the PV cell
i have the simulated data Pmpp and the experimetal data Pmpp
now i want to do it online to update comtimuosly the parameters
the problem is that most of the apps and blocks in simulink support using an Autoregressive models like ARX ARMA …
But iwant to do it with my simulink model
Any helpI have stucked in this details for months now
I have constructed my simulink model which is a little complicated (containing a PV array + DC/DC converter ) using simscape
the simulation is working for this first stage
The second stage is to use online parameter estimation to estimate the time varying parameter of the PV cell
i have the simulated data Pmpp and the experimetal data Pmpp
now i want to do it online to update comtimuosly the parameters
the problem is that most of the apps and blocks in simulink support using an Autoregressive models like ARX ARMA …
But iwant to do it with my simulink model
Any help I have stucked in this details for months now
I have constructed my simulink model which is a little complicated (containing a PV array + DC/DC converter ) using simscape
the simulation is working for this first stage
The second stage is to use online parameter estimation to estimate the time varying parameter of the PV cell
i have the simulated data Pmpp and the experimetal data Pmpp
now i want to do it online to update comtimuosly the parameters
the problem is that most of the apps and blocks in simulink support using an Autoregressive models like ARX ARMA …
But iwant to do it with my simulink model
Any help recursive, least square, parameter estimation, online MATLAB Answers — New Questions
Licensing Auto-Label Policies for Sensitivity Labels
Peeling Away the Layers to Find the Cheapest Auto-Label Option
Last week, I discussed how to use auto-label policies to apply sensitivity labels to old files in SharePoint Online sites to prevent their discovery and use by Microsoft 365 Copilot. The approach works but it’s only viable if a Microsoft 365 tenant has the necessary licenses to support auto-label policies.
Understanding Microsoft licensing is an art form and getting things right is important when a licensing decision might affect everyone in a tenant. In this instance, the requirements for information protection service-side automatic sensitivity labeling from the Purview service descriptions and license guidelines page seem pretty straightforward (Figure 1).

The same information is available in the Microsoft 365 Compliance Licensing Comparison Excel worksheet (also available as a PDF).
Licensing Trainable Classifiers
Purview extends over many different solutions. In my original article, I suggest using a trainable classifier to locate old files, so we need to check that licenses under consideration also cover trainable classifiers. The same page says:
“To auto-apply retention labels using a trainable classifier, the following licenses provide user rights:
- Microsoft 365 E5/A5/G5
- Microsoft 365 E5/A5/G5/F5 Compliance and F5 Security & Compliance
- Microsoft 365 E5/A5/F5/G5 Information Protection and Governance”
Licensing Costs
It seems clear then that the licensing requirement is met by having one of these SKUs (listed in order of cost):
- Microsoft 365 E5 (or Office 365 E5).
- The Microsoft E5 Compliance add-on ($12/user/month)
- The Microsoft E5 Information Protection and Governance add-on ($7/user/month).
Microsoft 365 E5 Information Protection and Governance add-on is a subset of the Microsoft 365 E5 Compliance product. According to this page, the Information Protection and Governance add-in is available for the following base licenses (Figure 2):

Interestingly, although Microsoft 365 Business Premium supports the E5 Security add-on, Microsoft still doesn’t support the E5 Compliance add-on for these customers – but Microsoft 365 Business Premium tenants can buy the Information Protection and Governance add-on. It’s an anomaly.
The takeaway is that if a tenant can restrict its licensing requirements to as tight a set as possible, it might be possible to reduce the overall cost for extra licenses quite considerably.
Who Needs the Licenses?
Microsoft’s general licensing guideline for Purview solutions is that anyone who benefits from a feature must be licensed for that feature. In practical terms, this means that anyone with access to a SharePoint Online site that’s processed by an auto-label policy requires a license. The same rule applies to other forms of auto-labeling, such as defining a default sensitivity label for a document library.
The DIY Option to Sensitivity Labeling
Let’s imagine that you don’t want to pay Microsoft any more licensing fees but still want to apply a sensitivity label to a bunch of old files. It’s possible to do this with a DIY app, but it will still cost because the Graph assignSensitivityLabel API is a metered API and costs $0.00185 each time the API applies a label to a file, or $185 per 100,000 files.
Sensitivity labels can’t process every type of file that’s found in SharePoint Online. The API can only deal with Office documents and PDF files. Older Office documents (.DOC, .XLS, and .PPT files) are unsupported, so some testing is needed to establish exactly what in the target content can be processed.
If you only plan to apply sensitivity labels to a set of known files and don’t need to use advanced capabilities like trainable classifiers to find items like invoices, customer orders, project plans, and so on, then the DIY option could be the right choice. The code to report the files in a SharePoint document library isn’t hard, and once you have a list of files, you can review and trim the set and then use it as input to an app to apply sensitivity labels.
Depending on how many files are to be processed, the DIY
approach can save a lot of money over licensing costs. Apart from having to pay to create, test, deploy, and support the code, the downside is that DIY labeling is a one-off mechanism without the benefits of ongoing automatic labeling or any of the other advanced processing built into Purview. You pay your money and make your choice!
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
The settling time in matlab differs from the calculated value
Hi,
Why does Matlab calculate the settling time which measures the time for the error to fall below 2% of the peak value of the error for the closed-loop function T given below differently from the calculated value?
Cheers,
T= 4/( s^2 + 1.6 s+4)
Calculated settling time=4/(wn*zeta)=5 s;
where wn=2, zeta=0.4.
s = stepinfo(T)
s =
struct with fields:
RiseTime: 0.7326
TransientTime: 4.2047
SettlingTime: 4.2047
SettlingMin: 0.9065
SettlingMax: 1.2537
Overshoot: 25.3741
Undershoot: 0
Peak: 1.2537
PeakTime: 1.7269Hi,
Why does Matlab calculate the settling time which measures the time for the error to fall below 2% of the peak value of the error for the closed-loop function T given below differently from the calculated value?
Cheers,
T= 4/( s^2 + 1.6 s+4)
Calculated settling time=4/(wn*zeta)=5 s;
where wn=2, zeta=0.4.
s = stepinfo(T)
s =
struct with fields:
RiseTime: 0.7326
TransientTime: 4.2047
SettlingTime: 4.2047
SettlingMin: 0.9065
SettlingMax: 1.2537
Overshoot: 25.3741
Undershoot: 0
Peak: 1.2537
PeakTime: 1.7269 Hi,
Why does Matlab calculate the settling time which measures the time for the error to fall below 2% of the peak value of the error for the closed-loop function T given below differently from the calculated value?
Cheers,
T= 4/( s^2 + 1.6 s+4)
Calculated settling time=4/(wn*zeta)=5 s;
where wn=2, zeta=0.4.
s = stepinfo(T)
s =
struct with fields:
RiseTime: 0.7326
TransientTime: 4.2047
SettlingTime: 4.2047
SettlingMin: 0.9065
SettlingMax: 1.2537
Overshoot: 25.3741
Undershoot: 0
Peak: 1.2537
PeakTime: 1.7269 the settling time in matlab differs MATLAB Answers — New Questions
Connect line using add_line command to same port connections
While I tried to collect lines in paralel, an error popup:
>> Battery_Array_tmp
Error using Battery_Array_tmp (line 33)
The first port already has a line connection
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_Add_MC_cube{v-1,i}.LConn(2),PH_Add_MC_cube{v,i}.LConn(2),’Autorouting’,’on’);
end
Can someone assist to solve it?
I adding part of rellevant script:
%%%% Scriptto creat top design – withot Batteries/
%%%% only to speedup simulation time during debug Block connections
open_system(‘Battery_arc_tmp’)
mdl = ‘Battery_arc_tmp’;
battery_model = find_system(mdl,’FindAll’,’on’,’Name’,’Battery_arc_tmp’);
numRows = 3;
% Get handle to existing (external) POS and NEG ports
Plus_MC = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’POS’);
Minus_MC = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’NEG’);
%%% add MC_cube – basic String_unit:
for i=1:2 %% set two columns
colPos = 500; %% spaces between columns
for v=1:numRows %% loop for 5 String per column
nl=num2str(v + numRows*(i-1));
if i==1
% Add_MC_cube(v) = add_block(‘MC_Cube/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
% % % % % % MC_TMP empty Submodule – only for quick compilation….
Add_MC_cube(v) = add_block(‘MC_TMP/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
else
% Add_MC_cube(v) = add_block(‘MC_Cube2/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
% % % % % % MC_TMP empty Submodule – only for quick compilation….
Add_MC_cube(v) = add_block(‘MC_TMP2/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
end
posc = get(Add_MC_cube(v),’Position’);
set(Add_MC_cube(v),’Position’,posc + [100+(i-1)*colPos 100*(v-1)+45 100+(i-1)*colPos 100*(v-1)+45])
PH_Add_MC_cube{v,i}=get(Add_MC_cube(v),’PortHandles’);
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_Add_MC_cube{v-1,i}.LConn(2),PH_Add_MC_cube{v,i}.LConn(2),’Autorouting’,’on’);
end
end
end
while connecting 2 module there is no problem/
But when increase above 2 module i gos an error message (above)..
please, see pic attached…
Thank for assist.
TommyWhile I tried to collect lines in paralel, an error popup:
>> Battery_Array_tmp
Error using Battery_Array_tmp (line 33)
The first port already has a line connection
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_Add_MC_cube{v-1,i}.LConn(2),PH_Add_MC_cube{v,i}.LConn(2),’Autorouting’,’on’);
end
Can someone assist to solve it?
I adding part of rellevant script:
%%%% Scriptto creat top design – withot Batteries/
%%%% only to speedup simulation time during debug Block connections
open_system(‘Battery_arc_tmp’)
mdl = ‘Battery_arc_tmp’;
battery_model = find_system(mdl,’FindAll’,’on’,’Name’,’Battery_arc_tmp’);
numRows = 3;
% Get handle to existing (external) POS and NEG ports
Plus_MC = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’POS’);
Minus_MC = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’NEG’);
%%% add MC_cube – basic String_unit:
for i=1:2 %% set two columns
colPos = 500; %% spaces between columns
for v=1:numRows %% loop for 5 String per column
nl=num2str(v + numRows*(i-1));
if i==1
% Add_MC_cube(v) = add_block(‘MC_Cube/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
% % % % % % MC_TMP empty Submodule – only for quick compilation….
Add_MC_cube(v) = add_block(‘MC_TMP/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
else
% Add_MC_cube(v) = add_block(‘MC_Cube2/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
% % % % % % MC_TMP empty Submodule – only for quick compilation….
Add_MC_cube(v) = add_block(‘MC_TMP2/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
end
posc = get(Add_MC_cube(v),’Position’);
set(Add_MC_cube(v),’Position’,posc + [100+(i-1)*colPos 100*(v-1)+45 100+(i-1)*colPos 100*(v-1)+45])
PH_Add_MC_cube{v,i}=get(Add_MC_cube(v),’PortHandles’);
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_Add_MC_cube{v-1,i}.LConn(2),PH_Add_MC_cube{v,i}.LConn(2),’Autorouting’,’on’);
end
end
end
while connecting 2 module there is no problem/
But when increase above 2 module i gos an error message (above)..
please, see pic attached…
Thank for assist.
Tommy While I tried to collect lines in paralel, an error popup:
>> Battery_Array_tmp
Error using Battery_Array_tmp (line 33)
The first port already has a line connection
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_Add_MC_cube{v-1,i}.LConn(2),PH_Add_MC_cube{v,i}.LConn(2),’Autorouting’,’on’);
end
Can someone assist to solve it?
I adding part of rellevant script:
%%%% Scriptto creat top design – withot Batteries/
%%%% only to speedup simulation time during debug Block connections
open_system(‘Battery_arc_tmp’)
mdl = ‘Battery_arc_tmp’;
battery_model = find_system(mdl,’FindAll’,’on’,’Name’,’Battery_arc_tmp’);
numRows = 3;
% Get handle to existing (external) POS and NEG ports
Plus_MC = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’POS’);
Minus_MC = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’NEG’);
%%% add MC_cube – basic String_unit:
for i=1:2 %% set two columns
colPos = 500; %% spaces between columns
for v=1:numRows %% loop for 5 String per column
nl=num2str(v + numRows*(i-1));
if i==1
% Add_MC_cube(v) = add_block(‘MC_Cube/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
% % % % % % MC_TMP empty Submodule – only for quick compilation….
Add_MC_cube(v) = add_block(‘MC_TMP/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
else
% Add_MC_cube(v) = add_block(‘MC_Cube2/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
% % % % % % MC_TMP empty Submodule – only for quick compilation….
Add_MC_cube(v) = add_block(‘MC_TMP2/STRING_MC_Cube 1’, [mdl,’/STRING_MC_Cube ‘,nl]);
end
posc = get(Add_MC_cube(v),’Position’);
set(Add_MC_cube(v),’Position’,posc + [100+(i-1)*colPos 100*(v-1)+45 100+(i-1)*colPos 100*(v-1)+45])
PH_Add_MC_cube{v,i}=get(Add_MC_cube(v),’PortHandles’);
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_Add_MC_cube{v-1,i}.LConn(2),PH_Add_MC_cube{v,i}.LConn(2),’Autorouting’,’on’);
end
end
end
while connecting 2 module there is no problem/
But when increase above 2 module i gos an error message (above)..
please, see pic attached…
Thank for assist.
Tommy matlab, simulink MATLAB Answers — New Questions
quadgk AbsTol/RelTol parameters combinations
Dear network.
I am having trouble getting the desired result of an integral involving Bessel functions Jo and Yo.
Need your help with a powerful set of combinations of the AbsTol/RelTol parameters that will help me get a low-error result
This is the equation I am trying to solve, with t as a parameter:Dear network.
I am having trouble getting the desired result of an integral involving Bessel functions Jo and Yo.
Need your help with a powerful set of combinations of the AbsTol/RelTol parameters that will help me get a low-error result
This is the equation I am trying to solve, with t as a parameter: Dear network.
I am having trouble getting the desired result of an integral involving Bessel functions Jo and Yo.
Need your help with a powerful set of combinations of the AbsTol/RelTol parameters that will help me get a low-error result
This is the equation I am trying to solve, with t as a parameter: quadgk abstol reltol MATLAB Answers — New Questions
Problems encountered when using sph2cart
Here is the code:
clear all
clc
close all
load angles.mat
load vertices.mat
[vectors(:,1), vectors(:,2), vectors(:,3)] = sph2cart(angle_phi_theta(:,1), angle_phi_theta(:,2), 1);
quiver3(vertex_segment(:,1),vertex_segment(:,2),vertex_segment(:,3),…
vectors(:,1),vectors(:,2),vectors(:,3),0.8,’Color’,’green’,’LineWidth’,1);hold on;
The results:
Problem: I think the resulting vectors should converge uniformly or diverge uniformly, but why do they alternate like this? What went wrong?Here is the code:
clear all
clc
close all
load angles.mat
load vertices.mat
[vectors(:,1), vectors(:,2), vectors(:,3)] = sph2cart(angle_phi_theta(:,1), angle_phi_theta(:,2), 1);
quiver3(vertex_segment(:,1),vertex_segment(:,2),vertex_segment(:,3),…
vectors(:,1),vectors(:,2),vectors(:,3),0.8,’Color’,’green’,’LineWidth’,1);hold on;
The results:
Problem: I think the resulting vectors should converge uniformly or diverge uniformly, but why do they alternate like this? What went wrong? Here is the code:
clear all
clc
close all
load angles.mat
load vertices.mat
[vectors(:,1), vectors(:,2), vectors(:,3)] = sph2cart(angle_phi_theta(:,1), angle_phi_theta(:,2), 1);
quiver3(vertex_segment(:,1),vertex_segment(:,2),vertex_segment(:,3),…
vectors(:,1),vectors(:,2),vectors(:,3),0.8,’Color’,’green’,’LineWidth’,1);hold on;
The results:
Problem: I think the resulting vectors should converge uniformly or diverge uniformly, but why do they alternate like this? What went wrong? coordinate transformation, sph2cart, vectors MATLAB Answers — New Questions
Entra ID to Disable Service Principal-Less Authentication
Block for Service Principal-Less Authentication in March 2026
One of the latest announcements from Microsoft engineering groups to improve the overall security of their cloud infrastructure is Entra’s decision to halt service principal-less authentication from March 2026. It’s an example of eradicating old practices that are unacceptable in today’s threat environment.
Service principal-less authentication happens when an enterprise app (aka a multitenant app) is used without a service principal in the host tenant. Enterprise apps are created by Microsoft and other software vendors. The Microsoft Graph Command Line Tools app (used to connect to the Microsoft Graph with PowerShell) is an example of a multitenant app. In this case, the Microsoft Graph Command Line Tools app has a service principal in the host tenant, which the app uses to hold the set of delegated Graph permissions available in interactive PowerShell sessions.
The Lack of a Service Principal
When an enterprise app doesn’t have a service principal, it probably means that the app only needs a basic level of authentication to allow the app to run. Post authentication, the app takes care of whatever processing it needs to do without using tenant-assigned permissions. Microsoft wants to block this kind of authentication saying that “Service principal-less authentication can be abused if the resource applications (i.e. APIs) perform incomplete validations.” Microsoft says that they have verified that validations aren’t vulnerable to service principal-less authentication, but they want to block the route now to avoid the possibility of a gap appearing in the future.
Reading between the lines, Microsoft doesn’t want apps to simply appear in a tenant, have a fairly loose connection to Entra ID, and be able to process data without administrative oversight.
After the block is active from March 2026, Entra ID will not allow enterprise apps to authenticate if they don’t have a matching service principal. It’s therefore wise to check tenants to identify any apps in this category to allow the problem to be mitigated.
Finding Problem Enterprise Apps
In their documentation, Microsoft explains how to use sign-in logs to identify problem enterprise apps. The advice focuses on looking for information through the Service principal sign-ins tab. I didn’t find anything there, but I found some interesting results by scanning sign-in logs for interactive connections. This code looks for sign-ins that have a service principal of ‘00000000-0000-0000-0000-000000000000’ and reports what it finds (this article describes a more comprehensive script to report service principal sign-ins):
$Uri = "https://graph.microsoft.com/beta/auditLogs/signIns?`$filter=servicePrincipalId eq '00000000-0000-0000-0000-000000000000'" [array]$Data = Invoke-MgGraphRequest -Uri $Uri -Method Get $Data = $Data.Value $Data | Group-Object ResourceDisplayName -NoElement | Sort-Object Count | Format-Table Name, Count Name Count ---- ----- Exchange Admin Center 1 Microsoft 365 App Catalog Services 1 Microsoft Activity Feed Service 1 Microsoft Office 365 Portal 1 OfficeHome 1 Password Breach Authenticator 1 Microsoft Edge Auth 3 Account Linking 5 IrisSelectionFrontDoor 5 Office365 Shell WCSS-Server 5 6 Augmentation Loop 6 Microsoft News Feed 10 Office 365 Exchange Microservices 10 Edge Sync 14
A bunch of Microsoft apps are in the collection, many of which appear in the Entra documentation explaining how to identify first-party apps. In addition, there’s an odd entry for a nameless app that comes from the Microsoft Services tenant (home tenant identifier f8cdef31-a31e-4b4a-93e4-5f571e91255a with an application identifier of 29d9ed98-a469-4536-ade2-f981bc1d605e). The default domain name for the app is sharepoint.com, so it’s reasonable to conclude that it’s something to do with SharePoint Online.
Figure 1 shows the details of a sign-in for the Office365 Shell WCSS-Server app, generated when I accessed the SharePoint Online admin center.

The Office365 Shell WCSS-Server app is browser code that runs whenever a user navigates to most Microsoft 365 browser apps. The shell, also known as the suite header, is shared code that loads as part of almost all workloads, including SharePoint, OneDrive, Outlook, and Viva Engage. The code is probably performing some internal processing that doesn’t need the tenant to grant permissions, so it doesn’t have a service principal.
Mitigating the Lack of a Service Principal
All of this is very interesting, but Microsoft’s mitigation for service principal-less authentication is for tenants to create a service principal for each of the affected apps. Given that so many Microsoft apps seem to be affected, does this mean that tenant administrators will have to create service principals for these apps?
The answer is no. The Entra ID team confirmed to me that they’ll take care of Microsoft apps and will update the documentation to this effect. The mitigation requirement only arises for third-party enterprise apps. The call to action remains to check if any of these apps exist in your tenant, and if you find some examples, it’s time to contact the app owners to ask them how they plan to function when service principal-less authentication no longer works.
So much change, all the time. It’s a challenge to stay abreast of all the updates Microsoft makes across the Microsoft 365 ecosystem, including Entra ID. Subscribe to the Office 365 for IT Pros eBook to receive monthly insights into what happens, why it happens, and what new features and capabilities mean for your tenant.
General Availability of Indonesia Central Cloud Region
Baca dalam Bahasa Indonesia di sini
Microsoft’s first cloud region in Indonesia, called Indonesia Central, is now generally available. This cloud region includes three availability zones, which provide independent power, cooling and networking for higher availability needs.
This new region is designed to meet the highest standards of security, privacy, and regulatory compliance; empowering organizations across the world to innovate from and for Indonesia with low-latency, connectivity, and resiliency.
Starting today, organizations can choose the “Indonesia Central” region in their Azure portal.
Join us for the launch of Indonesia Central cloud region during the AI Tour Jakarta on 27 May 2025, hosted by Microsoft Cloud + AI Executive Vice President Scott Guthrie. For more information, visit Microsoft AI Tour Jakarta website.
###
General Availability Cloud Region Indonesia Central
Read in English here
Cloud region pertama Microsoft di Indonesia, yaitu Indonesia Central, kini telah tersedia secara umum (generally available). Cloud region ini mencakup tiga availability zones yang menyediakan daya, pendinginan, dan jaringan independen untuk ketersediaan yang lebih tinggi.
Cloud region baru ini dirancang untuk memenuhi standar tertinggi keamanan, privasi, dan kepatuhan regulasi; memberdayakan organisasi dari berbagai belahan dunia untuk berinovasi dari dan untuk Indonesia dengan latensi rendah, konektivitas, serta resiliensi.
Mulai hari ini, organisasi dapat memilih region “Indonesia Central” di portal Azure mereka.
Bergabunglah dengan kami pada peluncuran cloud region Indonesia Central di AI Tour Jakarta tanggal 27 Mei 2025, yang akan dibuka oleh Microsoft Cloud + AI Executive Vice President Scott Guthrie. Untuk informasi lebih lanjut, kunjungi situs web Microsoft AI Tour Jakarta.
###
How to disable Tab completion in MATLAB Editor and Command Window
Is it possible to disable Tab completion in the MATLAB Editor and Command Window?Is it possible to disable Tab completion in the MATLAB Editor and Command Window? Is it possible to disable Tab completion in the MATLAB Editor and Command Window? disable, tab, completion MATLAB Answers — New Questions
Bayesian neural network for nonlinear model identification
Hello everyone,
I’m interested in using Bayesian neural networks to model a dynamical system, similar to the examples presented here: https://www.mathworks.com/help/ident/nonlinear-model-identification.html.
So far, the only relevant resource I’ve found is this page: https://www.mathworks.com/help/deeplearning/ug/train-bayesian-neural-network.html, which demonstrates how to train a Bayesian neural network to predict the rotation of handwritten digits.
Would the methodology and functions shown in that example be suitable for my case? Specifically, can they be adapted to train a model using time series data—i.e., sequences of input and output over time?
Thank you in advance for your support!
MarcoHello everyone,
I’m interested in using Bayesian neural networks to model a dynamical system, similar to the examples presented here: https://www.mathworks.com/help/ident/nonlinear-model-identification.html.
So far, the only relevant resource I’ve found is this page: https://www.mathworks.com/help/deeplearning/ug/train-bayesian-neural-network.html, which demonstrates how to train a Bayesian neural network to predict the rotation of handwritten digits.
Would the methodology and functions shown in that example be suitable for my case? Specifically, can they be adapted to train a model using time series data—i.e., sequences of input and output over time?
Thank you in advance for your support!
Marco Hello everyone,
I’m interested in using Bayesian neural networks to model a dynamical system, similar to the examples presented here: https://www.mathworks.com/help/ident/nonlinear-model-identification.html.
So far, the only relevant resource I’ve found is this page: https://www.mathworks.com/help/deeplearning/ug/train-bayesian-neural-network.html, which demonstrates how to train a Bayesian neural network to predict the rotation of handwritten digits.
Would the methodology and functions shown in that example be suitable for my case? Specifically, can they be adapted to train a model using time series data—i.e., sequences of input and output over time?
Thank you in advance for your support!
Marco bayes, neural networks, system identification, deep learning, uncertainty quantification MATLAB Answers — New Questions
Cannot get simulation to run after 2024 upgrade from 2023.
I upgraded from MATLAB/SIMULINK 2023 to 2024. When trying to rerun the simulation that had run in 2023 I get:
"
Error:Unable to update models referenced by ‘plant’.
Caused by:
The corresponding ‘decay_heat_SF.tlc’ file for the MATLAB S-function ‘decay_heat_SF’ in block ‘decay_heat/Level-2 MATLAB S-Function’ must be located in the current working directory, the MATLAB S-function directory ‘D:OneDriveUSNCControl DesignDecay Heat’, or the directory ‘D:OneDriveUSNCControl DesignDecay Heattlc_c’
"
Under 2023b no "decay_heat_SF.tlc" was generated or needed.
When running "decay_heat_SF" as a standalone model it runs. When added as a sub-model in "plant" it gives this error.
Can someone help?I upgraded from MATLAB/SIMULINK 2023 to 2024. When trying to rerun the simulation that had run in 2023 I get:
"
Error:Unable to update models referenced by ‘plant’.
Caused by:
The corresponding ‘decay_heat_SF.tlc’ file for the MATLAB S-function ‘decay_heat_SF’ in block ‘decay_heat/Level-2 MATLAB S-Function’ must be located in the current working directory, the MATLAB S-function directory ‘D:OneDriveUSNCControl DesignDecay Heat’, or the directory ‘D:OneDriveUSNCControl DesignDecay Heattlc_c’
"
Under 2023b no "decay_heat_SF.tlc" was generated or needed.
When running "decay_heat_SF" as a standalone model it runs. When added as a sub-model in "plant" it gives this error.
Can someone help? I upgraded from MATLAB/SIMULINK 2023 to 2024. When trying to rerun the simulation that had run in 2023 I get:
"
Error:Unable to update models referenced by ‘plant’.
Caused by:
The corresponding ‘decay_heat_SF.tlc’ file for the MATLAB S-function ‘decay_heat_SF’ in block ‘decay_heat/Level-2 MATLAB S-Function’ must be located in the current working directory, the MATLAB S-function directory ‘D:OneDriveUSNCControl DesignDecay Heat’, or the directory ‘D:OneDriveUSNCControl DesignDecay Heattlc_c’
"
Under 2023b no "decay_heat_SF.tlc" was generated or needed.
When running "decay_heat_SF" as a standalone model it runs. When added as a sub-model in "plant" it gives this error.
Can someone help? upgrade, tlc MATLAB Answers — New Questions
i need help in solving this documentation in mathlab “Fault Detection and Localization in Three-Phase Power Transmission Using Deep Signal Anomaly Detector in Simulink” thanks
i am trying to build the exact modle listed on the site but finding challenges navigating through the steps provided .the topic is" Fault Detection and Localization in Three-Phase Power Transmission Using Deep Signal Anomaly Detector in Simulink". i would be very glad if someone can assist me do it. or if anyone has already done it. the person can kindly share his file to assist me. thank youi am trying to build the exact modle listed on the site but finding challenges navigating through the steps provided .the topic is" Fault Detection and Localization in Three-Phase Power Transmission Using Deep Signal Anomaly Detector in Simulink". i would be very glad if someone can assist me do it. or if anyone has already done it. the person can kindly share his file to assist me. thank you i am trying to build the exact modle listed on the site but finding challenges navigating through the steps provided .the topic is" Fault Detection and Localization in Three-Phase Power Transmission Using Deep Signal Anomaly Detector in Simulink". i would be very glad if someone can assist me do it. or if anyone has already done it. the person can kindly share his file to assist me. thank you #simulink, #deep signal anomaly detector #matlab MATLAB Answers — New Questions
Microsoft Attempts to Fix Microsoft Graph PowerShell SDK Problem with Azure Automation
.NET Dependencies Stop Microsoft Graph PowerShell SDK Authentication in Runbooks
As anyone who keeps tabs on the Microsoft Graph PowerShell SDK, the V2.26 release was a disaster. Poor testing and other failures let obvious problems escape into customer environments. To be fair to Microsoft, the development group fixed some of the more grievous problems and issued version 2.26.1 a week or so after V2.26 appeared.
Alas, V2.26.1 came with its own set of flaws, notably breaking Azure Automation runbooks that use PowerShell V7.1 and V7.2 because the SDK developers decided to remove support for .NET 6. Cue the infamous “invalid JWT access token” issue (Figure 1).

All in all, the Microsoft Graph PowerShell SDK descended into grand farce, and no one knew what would happen next. The problem only happens for runbooks based on PowerShell V7.1 and V7.2. It doesn’t arise when runbooks use PowerShell V5.1.
Microsoft’s Solution – Azure Automation Support for PowerShell V7.4
On April 10, 2025, Microsoft laid out their plans to clean up the mess. Explaining that the root cause of the problem in V2.26.1 is a component conflict between the Exchange Online PowerShell module and the Microsoft Graph PowerShell SDK that prevents the Connect-MgGraph cmdlet working, Microsoft says that the issue is resolved when Azure Automation is upgraded to support PowerShell V7.4 (based on .NET 8). A preview of PowerShell V7.4 support is available today.
Microsoft doesn’t say when Azure Automation will fully support PowerShell V7.4 support in a generally available version. However, they do say that the next release of the Microsoft Graph PowerShell SDK is “expected later this month.” Given the recent problems in SDK versions, it’s inconceivable that Microsoft would push out a new version of the SDK without full and stable support for Azure Automation, and that means PowerShell V7.4 support.
In the interim, if you have Azure Automation runbooks, stay with Microsoft Graph PowerShell SDK V2.25.
Work Remains to be Done
Assuming that Microsoft delivers a new version of the Microsoft Graph PowerShell SDK that delivers “enhanced stability” (couldn’t be worse than the last two versions), “compatibility and performance” and address the many issues reported in the SDK GitHub repository (163 open at present), is that the end of this saga?
I don’t think so. The history of the Microsoft Graph PowerShell SDK is littered with poor quality and buggy releases. The clash with the Exchange Online PowerShell module speaks of a failure within Microsoft to coordinate updates to critical PowerShell modules used by Microsoft 365 customers. Given the closely-connected nature of Microsoft 365, it’s unacceptable for engineering groups to make changes to PowerShell modules without understanding if their updates will impact modules like Teams, SharePoint, and Exchange.
Quality instead of Fast-Paced Releases
Customers need a sustained run of high-quality Microsoft Graph PowerShell SDK releases to rebuild faith. In the past, Microsoft issued new SDK versions on a monthly cadence in an attempt to keep up with changes in Graph APIs. That cadence is too rapid. Stability should be the name of the game from here on with focus on delivering a high-quality quarterly SDK. Lessening the pace will permit the SDK engineers to coordinate better with their peers and burn down the swelling bug list. If people need to use a new Graph API, there’s no need to wait for Microsoft to build an SDK cmdlet because they can always use the API via the Invoke-MgGraphRequest cmdlet.
Over three million downloads now occur for new SDK versions. It’s time that Microsoft treats the Microsoft Graph PowerShell SDK as what it is: a serious piece of the PowerShell framework for Microsoft 365 automation.
assigning values with []
[a,b]=[1,2]
Why doesn’t this work? How to rewrite into what is easier and more succinct than a=1; b=2?[a,b]=[1,2]
Why doesn’t this work? How to rewrite into what is easier and more succinct than a=1; b=2? [a,b]=[1,2]
Why doesn’t this work? How to rewrite into what is easier and more succinct than a=1; b=2? matlab MATLAB Answers — New Questions
Unknown error during installation MATLAB2015a
During the installation of Matlab 2015a, at a level of 99% a pop-up window appeared with the following notification: " Unknown Error. The application encountered an unexpected error and needs to close. You may want to try re-installing your product(s). More information can be found at C:users…Tempmathworks_cform.log".
Why does this error appear during installation?
How can I solve that?During the installation of Matlab 2015a, at a level of 99% a pop-up window appeared with the following notification: " Unknown Error. The application encountered an unexpected error and needs to close. You may want to try re-installing your product(s). More information can be found at C:users…Tempmathworks_cform.log".
Why does this error appear during installation?
How can I solve that? During the installation of Matlab 2015a, at a level of 99% a pop-up window appeared with the following notification: " Unknown Error. The application encountered an unexpected error and needs to close. You may want to try re-installing your product(s). More information can be found at C:users…Tempmathworks_cform.log".
Why does this error appear during installation?
How can I solve that? error, installation MATLAB Answers — New Questions