Month: January 2026
How can I set an expiration or override date for my license file?
How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself?How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself? How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself? MATLAB Answers — New Questions
How do I license my Docker container using a Campus-Wide or Startup Individual license?
How do I license my Docker container using a Campus-Wide or Startup Individual license?How do I license my Docker container using a Campus-Wide or Startup Individual license? How do I license my Docker container using a Campus-Wide or Startup Individual license? MATLAB Answers — New Questions
In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in
In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
endIn MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
end In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
end line number, prompt message ctrl+c MATLAB Answers — New Questions
Automating Microsoft 365 with PowerShell Update 20
Part of the Office 365 for IT Pros February 2026 Release
The Office 365 for IT Pros team is delighted to announce that update #20 for the Automating Microsoft 365 with PowerShell eBook is available for subscribers to download. The updated files are available to subscribers of both Automating Microsoft 365 with PowerShell and Office 365 for IT Pros (2026 edition). We will issue the February 2026 update for the main book on February 1, 2026.
Please use the link in the receipt emailed after purchase or your Gumroad.com account to fetch the updated PDF and EPUB files.
We have also updated the Kindle and Paperback editions that are available from Amazon.com. Subscribers who purchase through Gumroad and want to read the book on Kindle devices do so by transferring the EPUB file to their device.
Updates and Revisions in Automating Microsoft 365 with PowerShell #20
Like all our monthly releases, update #20 contains a mixture of new material, updates, and revisions (including a few fixes). The book now includes coverage of the create Site Graph API mentioned last month. Since the API first appeared, Microsoft decided to drop the ability to create new sites linked to Microsoft 365 Groups. In addition, the API sadly lacks some essential functionality, such as adding members to newly created sites.
A new section addresses the question of how to create channel meetings for Teams. The feature is an example of an internal API in action because it’s not possible to create the same kind of channel meeting with the Graph APIs. The workaround is to create a personal meeting (a regular calendar event) and then post a notice about the meeting in the channel. This works, but the meeting doesn’t appear in the channel calendar.
New Version of the Microsoft Graph PowerShell SDK
Soon after we announced the availability of update #19 for Automating Microsoft 365 with PowerShell in December, Microsoft shipped V2.34 of the Microsoft Graph PowerShell SDK. The updated module appeared just 12 days after V2.33, so it came as a complete surprise. Soon afterwards, we reported that security was the prime driver for the accelerated release. However, the PowerShell gallery reports nearly 30 downloads of V2.33, which indicates that quite a number of people haven’t got the message that they should upgrade to V2.34.
I’ve been using V2.34 since its release and haven’t detected any problems over and above known issues, like the removal of the BodyParameter parameter for several directory-related cmdlets.
Exchange Online PowerShell and the Graph SDK
Microsoft updated the Exchange Online PowerShell module to V3.9.2 on January 5, 2026, The only real change is the introduction of the EXOModuleBasePath parameter to point to the folder where the module downloads its temporary module files on startup. I assume that the change is intended to give more control over where these files go. For example, if you run:
Connect-ExchangeOnline -EXOModuleBasePath c:temp
You’ll end up with a temporary folder like C:TemptmpEXO_gbdobe5j.d3j where Exchange Online stores downloaded definitions for many of its PowerShell cmdlets (functions).
OperationStopped: Could not load file or assembly 'C:Program FilesPowerShellModulesExchangeOnlineManagement3.9.2netCoreMicrosoft.Identity.Client.dll'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
Or maybe the complaint about an error acquiring a token shown in Figure 1.

Running Connect-MgGraph after connecting to Exchange Online does not have the same problem. Assembly clashes remain a problem for Microsoft 365 PowerShell and are evidence of how teams in the world’s largest software company can utterly fail to cooperate around the use of common components. It’s a blessed mystery
If you’re looking for PowerShell code examples for Microsoft 365, why not visit the Office 365 for IT Pros GitHub repository. The repository holds over 300 scripts covering a wide range of situations.
I want to calculate efficiency, response time, and thd for Dynamic voltage restorer with FLC for power quality improvement.
I am done with the simulink,now try to calculate the thd ,efficiency and response time.i tried but cannot calculate.I am done with the simulink,now try to calculate the thd ,efficiency and response time.i tried but cannot calculate. I am done with the simulink,now try to calculate the thd ,efficiency and response time.i tried but cannot calculate. simulink, matlab MATLAB Answers — New Questions
Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Here is the sample
A=double.empty(5,0);
B=double.empty(0,5);
C=A*B
C =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Here is the sample
A=double.empty(5,0);
B=double.empty(0,5);
C=A*B
C =
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 Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Here is the sample
A=double.empty(5,0);
B=double.empty(0,5);
C=A*B
C =
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 mtimes, empty, arithmetic operations, operators and elementary operations MATLAB Answers — New Questions
TI C2000 I2C Receive with Interrupt not working (Simulink)
Hello,
I have a setup with a ESP32S3 Dev-Module as I²C master and a TI C2000 TMS320F28069M board as a I²C slave. The ESP32 is supposed to send the C2000 several signal. Each signal has three bytes. First a comand byte to separate the signals and then two bytes as payload (uint16 or int16). The C2000-code is implemented in Simulink. In the future, the C2000 shall respond to certain signals with data.
My first issue is that the I2C RCV (Receive) Block outputs my signals in a way that the the byte order changes. For example, the comand byte which is supposed to be always the first byte is sometimes the second or third byte. The order changes throughout restarts and is not predictable. As a solution to this problem I want to use I²C interrupts. This brings me to my second and main question:
I can not get the I²C communication to work with the interrupts. My ESP32 stops sending data as soon as the C2000 code with I²C interrupts is uploaded and running. It seems like the I²C ISR of the C2000 is never called and somehow stops the ESP32 from sending further messages.
To diagnose my problem, I already did the following without success:
Added a free-running counter in the ISR-function to see if the function gets called. The counter stays at zero.
Analyzed and used code-fragments of the C2000 c28x_i2c_eeprom_interrupt example in my code.
Checked I²C with oscilloscope and bus-decoder: Without the Interrupts, the I²C Messages are transmitted and acknowledged. With Interrupt, a successful transmission happens exactly one time, then stops. SCL stays low, SDA stays high.
Tried different Interrupts, tried different interrupt settings.
My guesses:
Wrong settings/configuration of ISR/hardware /some registers
Timing problems
Some kind of incompactibility between C2000/ESP32
User error
I attached 4 screenshots of my settings, the my code-example and two screenshots without ISR and two with ISR of my oscilloscope.
I prepared a small Simulink file with my code. If you want to run the code, open "Nur_I2C.slx". Open the subsystem. There are two parts, one with ISR and one without. Just comment one part and uncomment the other. Everything after the delay is for the differentiation of the signals.Hello,
I have a setup with a ESP32S3 Dev-Module as I²C master and a TI C2000 TMS320F28069M board as a I²C slave. The ESP32 is supposed to send the C2000 several signal. Each signal has three bytes. First a comand byte to separate the signals and then two bytes as payload (uint16 or int16). The C2000-code is implemented in Simulink. In the future, the C2000 shall respond to certain signals with data.
My first issue is that the I2C RCV (Receive) Block outputs my signals in a way that the the byte order changes. For example, the comand byte which is supposed to be always the first byte is sometimes the second or third byte. The order changes throughout restarts and is not predictable. As a solution to this problem I want to use I²C interrupts. This brings me to my second and main question:
I can not get the I²C communication to work with the interrupts. My ESP32 stops sending data as soon as the C2000 code with I²C interrupts is uploaded and running. It seems like the I²C ISR of the C2000 is never called and somehow stops the ESP32 from sending further messages.
To diagnose my problem, I already did the following without success:
Added a free-running counter in the ISR-function to see if the function gets called. The counter stays at zero.
Analyzed and used code-fragments of the C2000 c28x_i2c_eeprom_interrupt example in my code.
Checked I²C with oscilloscope and bus-decoder: Without the Interrupts, the I²C Messages are transmitted and acknowledged. With Interrupt, a successful transmission happens exactly one time, then stops. SCL stays low, SDA stays high.
Tried different Interrupts, tried different interrupt settings.
My guesses:
Wrong settings/configuration of ISR/hardware /some registers
Timing problems
Some kind of incompactibility between C2000/ESP32
User error
I attached 4 screenshots of my settings, the my code-example and two screenshots without ISR and two with ISR of my oscilloscope.
I prepared a small Simulink file with my code. If you want to run the code, open "Nur_I2C.slx". Open the subsystem. There are two parts, one with ISR and one without. Just comment one part and uncomment the other. Everything after the delay is for the differentiation of the signals. Hello,
I have a setup with a ESP32S3 Dev-Module as I²C master and a TI C2000 TMS320F28069M board as a I²C slave. The ESP32 is supposed to send the C2000 several signal. Each signal has three bytes. First a comand byte to separate the signals and then two bytes as payload (uint16 or int16). The C2000-code is implemented in Simulink. In the future, the C2000 shall respond to certain signals with data.
My first issue is that the I2C RCV (Receive) Block outputs my signals in a way that the the byte order changes. For example, the comand byte which is supposed to be always the first byte is sometimes the second or third byte. The order changes throughout restarts and is not predictable. As a solution to this problem I want to use I²C interrupts. This brings me to my second and main question:
I can not get the I²C communication to work with the interrupts. My ESP32 stops sending data as soon as the C2000 code with I²C interrupts is uploaded and running. It seems like the I²C ISR of the C2000 is never called and somehow stops the ESP32 from sending further messages.
To diagnose my problem, I already did the following without success:
Added a free-running counter in the ISR-function to see if the function gets called. The counter stays at zero.
Analyzed and used code-fragments of the C2000 c28x_i2c_eeprom_interrupt example in my code.
Checked I²C with oscilloscope and bus-decoder: Without the Interrupts, the I²C Messages are transmitted and acknowledged. With Interrupt, a successful transmission happens exactly one time, then stops. SCL stays low, SDA stays high.
Tried different Interrupts, tried different interrupt settings.
My guesses:
Wrong settings/configuration of ISR/hardware /some registers
Timing problems
Some kind of incompactibility between C2000/ESP32
User error
I attached 4 screenshots of my settings, the my code-example and two screenshots without ISR and two with ISR of my oscilloscope.
I prepared a small Simulink file with my code. If you want to run the code, open "Nur_I2C.slx". Open the subsystem. There are two parts, one with ISR and one without. Just comment one part and uncomment the other. Everything after the delay is for the differentiation of the signals. c2000, i2c, i²c, communication, hardware, isr, interrupt MATLAB Answers — New Questions
Generate a Weekly Report of Role Assignments
Use Email to Circulate Details of Role Assignments and Removals
Writing about the arrival of the Teams external collaboration role, I made the point that it’s a good idea to conduct a periodic review of role assignments within Microsoft 365 tenants to make sure that people don’t cling onto roles when those roles are no longer required. Well, it’s also a good idea to keep an eye on role assignments (additions and removals) as they occur.
Reviewing a complete Entra ID role assignment report is one way to find unnecessary roles assignments, but busy tenant administrators might not have the time to check each assignment. Dealing with just the assignment changes that occur within the last week is a more achievable task. Fortunately, the work involved in generating such a report and delivering it via email isn’t very difficult.
Accessing Role Assignment Audit Records
Entra ID captures audit records every time an administrator creates a new role assignment or removes an existing role assignment. The audit records are available through the Entra admin center or programmatically through a Graph API. The audit records also flow through to the unified audit log, where the data is accessible through the Purview audit solution, the Search-UnifiedAuditLog cmdlet, and the AuditLogQuery Graph API. Microsoft is dealing with some known issues in the AuditLogQuery API at present, so that option is not recommended.
I like the idea of automating tasks that should be performed regularly and prefer to use Azure Automation to run procedures on a dependable scheduled basis. To keep things simple, I decided to avoid using the Search-UnifiedAuditLog cmdlet and retrieve the audit data from Entra ID instead. This approach allows me to use the Microsoft Graph PowerShell SDK for everything and avoid any possibility of assembly clashes.
After connecting to the Graph with the AuditLog.Read.All scope, this command finds all role assignment addition and removal records for the last week:
# Retrieve role assignment events from the last week
$StartDate = (Get-Date).AddDays(-7).toString('yyyy-MM-dd')
Write-Output "Checking for role assignments in the last week since $StartDate..."
[array]$Records = Get-MgAuditLogDirectoryAudit -All -Filter `
"(activityDisplayName eq 'Add member to role' or activityDisplayName eq 'Remove member from role') and ActivityDateTime gt $StartDate"
An Entra ID audit record looks like this:
ActivityDateTime : 14/01/2026 14:42:43
ActivityDisplayName : Add member to role
AdditionalDetails : {}
Category : RoleManagement
CorrelationId : 6f5d5a61-89af-46f2-af4c-b03e08fbb4c2
Id : Directory_6f5d5a61-89af-46f2-af4c-b03e08fbb4c2_AH36X_123650044
InitiatedBy : Microsoft.Graph.PowerShell.Models.MicrosoftGraphAuditActivityInitiator
LoggedByService : Core Directory
OperationType : Assign
Result : success
ResultReason :
TargetResources : {4adf6057-95da-430a-8757-6a58c85e13d4, 53add08e-5b0c-4276-a582-9ce02fb6c947}
AdditionalProperties : {}
Like with any audit record, some processing is required to extract the interesting information. For example, the targetResources property holds details of the user account and role involved in the assignment:
Id Type UserPrincipalName -- ---- ----------------- 4adf6057-95da-430a-8757-6a58c85e13d4 User Michelle.Dubois@office365itpros.com 53add08e-5b0c-4276-a582-9ce02fb6c947 Role
The InitiatedBy property holds details of the process or user responsible for initiating the change. If you use Entra Privileged Identity Management, many of the changes are made by an enterprise app called MS-PIM (service principal ddfe4cbb-47fa-4aa0-95c0-430644c7dc5d).
Highlighting Critical Role Assignments
After extracting information from the audit records, you can format the data in whatever way makes sense to highlight it to administrators. For example, an assignment of the Global Reader role is probably not very exciting and worth much attention, but the assignment of a workload administrative role like SharePoint administrator or Teams administrator is a much more important event. Other critical roles include Privileged Role administrator and security administrator. To highlight assignments for critical roles (defined in an array), the processing adds a suitable icon to include in the output.
Bringing everything together, we can generate an Excel worksheet (if the ImportExcel module is available) or CSV file and attach it to an email sent to interested parties. By adding the runbook to a suitable Azure Automation schedule, we can assure that the weekly report is delivered to mailboxes (Figure 1) at a suitable time (9AM on Monday seems good).

Access to the Script to Send the Weekly Role Assignment Report
If you’d like a copy of the complete script, you can download it from the Office 365 GitHub repository. The code runs interactively and as an Azure Automation runbook. If you run the script interactively, the code sends the message from the mailbox of the signed-in account. Make sure that you update the code with a suitable destination address for your tenant.
PS. I am scheduled to speak about using Azure Automation with Microsoft 365 at the Microsoft 365 Community Conference in Orlando in April. If you’d like to come along, you can use the code REDMOND150 to get a $150 discount.
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.
Guidance on Space Vector PWM Implementation in Simulink
Dear MathWorks Team,
I am writing to seek guidance on implementing Space Vector Pulse Width Modulation (SVPWM) in Simulink.
In recent releases, specifically MATLAB/Simulink 2025b, the blocks “SVPWM Generator (2-level)” and “SVPWM Generator (3-level)”, which were previously intended for this purpose, are no longer available. According to the documentation on your website, these blocks are expected to be removed.
I would appreciate it if you could advise on recommended alternatives or replacement solutions for implementing SVPWM in Simulink under the current software version. Any guidance toward supported blocks, example models, or best-practice approaches would be very helpful.
Thank you for your time and support.
Sincerely,
Sergi ZapaterDear MathWorks Team,
I am writing to seek guidance on implementing Space Vector Pulse Width Modulation (SVPWM) in Simulink.
In recent releases, specifically MATLAB/Simulink 2025b, the blocks “SVPWM Generator (2-level)” and “SVPWM Generator (3-level)”, which were previously intended for this purpose, are no longer available. According to the documentation on your website, these blocks are expected to be removed.
I would appreciate it if you could advise on recommended alternatives or replacement solutions for implementing SVPWM in Simulink under the current software version. Any guidance toward supported blocks, example models, or best-practice approaches would be very helpful.
Thank you for your time and support.
Sincerely,
Sergi Zapater Dear MathWorks Team,
I am writing to seek guidance on implementing Space Vector Pulse Width Modulation (SVPWM) in Simulink.
In recent releases, specifically MATLAB/Simulink 2025b, the blocks “SVPWM Generator (2-level)” and “SVPWM Generator (3-level)”, which were previously intended for this purpose, are no longer available. According to the documentation on your website, these blocks are expected to be removed.
I would appreciate it if you could advise on recommended alternatives or replacement solutions for implementing SVPWM in Simulink under the current software version. Any guidance toward supported blocks, example models, or best-practice approaches would be very helpful.
Thank you for your time and support.
Sincerely,
Sergi Zapater svpwm, svm, space vector modulation, simulink MATLAB Answers — New Questions
How to call the Simulink Test results inside the ForEach module?
Hello, I want to use the test results from Simulink Test to perform custom evaluation criteria. My model uses a For Each subsystem externally to calculate the maximum and minimum SOC of individual cells within a battery pack in parallel. The battery SOC is an output of the model, and for each battery’s SOC, I can record and call it using the code below:
soc = test.sltest_simout.get(‘logsout’).get(‘soc’).Values.Data;
soc_max = soc(:,1);
soc_min = soc(:,2);
However, I also want to record the terminal voltage estimation error of a battery inside the For Each subsystem. This value is internal to the For Each subsystem and is not output to the outside of the model. If I try to call the test data in the same way as above, I get an ‘index exceeds 1’ error:
v_error = test.sltest_simout.get(‘logsout’).get(‘v_error’).Values.Data;
v_max_error = v_error(:,1);
v_max_error = v_error(:,2);
In Simulink Test, there are also two output results, but it seems that it calculates them channel by channel. So, how should I call the v_error test results?Hello, I want to use the test results from Simulink Test to perform custom evaluation criteria. My model uses a For Each subsystem externally to calculate the maximum and minimum SOC of individual cells within a battery pack in parallel. The battery SOC is an output of the model, and for each battery’s SOC, I can record and call it using the code below:
soc = test.sltest_simout.get(‘logsout’).get(‘soc’).Values.Data;
soc_max = soc(:,1);
soc_min = soc(:,2);
However, I also want to record the terminal voltage estimation error of a battery inside the For Each subsystem. This value is internal to the For Each subsystem and is not output to the outside of the model. If I try to call the test data in the same way as above, I get an ‘index exceeds 1’ error:
v_error = test.sltest_simout.get(‘logsout’).get(‘v_error’).Values.Data;
v_max_error = v_error(:,1);
v_max_error = v_error(:,2);
In Simulink Test, there are also two output results, but it seems that it calculates them channel by channel. So, how should I call the v_error test results? Hello, I want to use the test results from Simulink Test to perform custom evaluation criteria. My model uses a For Each subsystem externally to calculate the maximum and minimum SOC of individual cells within a battery pack in parallel. The battery SOC is an output of the model, and for each battery’s SOC, I can record and call it using the code below:
soc = test.sltest_simout.get(‘logsout’).get(‘soc’).Values.Data;
soc_max = soc(:,1);
soc_min = soc(:,2);
However, I also want to record the terminal voltage estimation error of a battery inside the For Each subsystem. This value is internal to the For Each subsystem and is not output to the outside of the model. If I try to call the test data in the same way as above, I get an ‘index exceeds 1’ error:
v_error = test.sltest_simout.get(‘logsout’).get(‘v_error’).Values.Data;
v_max_error = v_error(:,1);
v_max_error = v_error(:,2);
In Simulink Test, there are also two output results, but it seems that it calculates them channel by channel. So, how should I call the v_error test results? simulink test, simulink, bms MATLAB Answers — New Questions
Eigenvalue analysis of Outer-tub dynamic assembly of Front load washing machine
Hi,
Currently , I am working on an MBD system (Outer-tub dynamic assembly of Front Load washing machine, with two hanging linear springs and 3 friction dampers). I want to compute the linearized dynamic model to perform the Eigenvalue analysis. I am following a research paper by Prof. Bae (An Implementation method of linearized equations of motion for multibody systems with closed loops). I compared the computed stiffness matric with Recurdyn computed stiffness matrix. RecurDyn provided two different stiffness matrices (one for static analysis and another one for Eigenvalue analysis). My stiffness matrix (Python code as Prof Bae paper) is matching with the Recurdyn stiffness matrix computed for static analysis.
I want to know why are these two stiffness matrices of RecurDyn different, and How to compute them?Hi,
Currently , I am working on an MBD system (Outer-tub dynamic assembly of Front Load washing machine, with two hanging linear springs and 3 friction dampers). I want to compute the linearized dynamic model to perform the Eigenvalue analysis. I am following a research paper by Prof. Bae (An Implementation method of linearized equations of motion for multibody systems with closed loops). I compared the computed stiffness matric with Recurdyn computed stiffness matrix. RecurDyn provided two different stiffness matrices (one for static analysis and another one for Eigenvalue analysis). My stiffness matrix (Python code as Prof Bae paper) is matching with the Recurdyn stiffness matrix computed for static analysis.
I want to know why are these two stiffness matrices of RecurDyn different, and How to compute them? Hi,
Currently , I am working on an MBD system (Outer-tub dynamic assembly of Front Load washing machine, with two hanging linear springs and 3 friction dampers). I want to compute the linearized dynamic model to perform the Eigenvalue analysis. I am following a research paper by Prof. Bae (An Implementation method of linearized equations of motion for multibody systems with closed loops). I compared the computed stiffness matric with Recurdyn computed stiffness matrix. RecurDyn provided two different stiffness matrices (one for static analysis and another one for Eigenvalue analysis). My stiffness matrix (Python code as Prof Bae paper) is matching with the Recurdyn stiffness matrix computed for static analysis.
I want to know why are these two stiffness matrices of RecurDyn different, and How to compute them? linearized dynamic model, eigenvalue analysis, outer-tub dynamic assembly wit, washing machine, static equilibrium, linear and torsional springs MATLAB Answers — New Questions
HDL multi rate simulation
I’m having trouble understanding how to speed up the simulation when everything is running at the hardware rate. I have a clock interface that is running at 50 MHz and I have simulink sampling rates set to 20e-9 s and then I have enabled the setting "Treat Simulink rates as actual hardware rates" in order to model to communication interface such as the AXI4 master correctly. However, the simulation comes to crawl even though controller and plant can be run at a slower rate. Is there a way I can speed up the simulation while maintaining cycle accurate fidelity?I’m having trouble understanding how to speed up the simulation when everything is running at the hardware rate. I have a clock interface that is running at 50 MHz and I have simulink sampling rates set to 20e-9 s and then I have enabled the setting "Treat Simulink rates as actual hardware rates" in order to model to communication interface such as the AXI4 master correctly. However, the simulation comes to crawl even though controller and plant can be run at a slower rate. Is there a way I can speed up the simulation while maintaining cycle accurate fidelity? I’m having trouble understanding how to speed up the simulation when everything is running at the hardware rate. I have a clock interface that is running at 50 MHz and I have simulink sampling rates set to 20e-9 s and then I have enabled the setting "Treat Simulink rates as actual hardware rates" in order to model to communication interface such as the AXI4 master correctly. However, the simulation comes to crawl even though controller and plant can be run at a slower rate. Is there a way I can speed up the simulation while maintaining cycle accurate fidelity? hdl coder MATLAB Answers — New Questions
How to view private properties of a class in the debugger?
I author a handful of Digital Signal Processing algorithms in System objects (they are very handy indeed). Recently after upgrading to R2025b from R2024a I’ve hit an annoying snag. Most of the state, etc. of a system object will be in private properties. In prior versions, I could set a breakpoint in the stepImpl for instance and if I clicked on "obj" (the standard internal name for my object handle inside methods), I could see in the variable editor the value of all the properties, not just the externally visible ones. Then, I could step through the algorithm and make sure everything was computing correctly. Now there’s no handy way to do this? I tried the class browser but that doesn’t readily show the values of the current instance of the class. Why was this critical feature broken?I author a handful of Digital Signal Processing algorithms in System objects (they are very handy indeed). Recently after upgrading to R2025b from R2024a I’ve hit an annoying snag. Most of the state, etc. of a system object will be in private properties. In prior versions, I could set a breakpoint in the stepImpl for instance and if I clicked on "obj" (the standard internal name for my object handle inside methods), I could see in the variable editor the value of all the properties, not just the externally visible ones. Then, I could step through the algorithm and make sure everything was computing correctly. Now there’s no handy way to do this? I tried the class browser but that doesn’t readily show the values of the current instance of the class. Why was this critical feature broken? I author a handful of Digital Signal Processing algorithms in System objects (they are very handy indeed). Recently after upgrading to R2025b from R2024a I’ve hit an annoying snag. Most of the state, etc. of a system object will be in private properties. In prior versions, I could set a breakpoint in the stepImpl for instance and if I clicked on "obj" (the standard internal name for my object handle inside methods), I could see in the variable editor the value of all the properties, not just the externally visible ones. Then, I could step through the algorithm and make sure everything was computing correctly. Now there’s no handy way to do this? I tried the class browser but that doesn’t readily show the values of the current instance of the class. Why was this critical feature broken? debug, system object MATLAB Answers — New Questions
Synchronizing Security and Microsoft 365 Group Memberships
Use the Graph APIs to Synchronize Group Memberships
A September 2018 article describes how to synchronize the membership of security groups with Microsoft 365 groups (or Office 365 groups as they were then). Looking at the example code in the article, it’s obvious that much has changed. The demise of the Azure AD PowerShell module and its replacement by the Entra module or the Microsoft Graph PowerShell SDK is probably the biggest change.
A security group is used to manage access to shared resources. It’s often desirable to have a way for members of the security group to share information and collaborate. A Microsoft 365 group is the obvious choice, and that’s what creates the need to synchronize membership between the security group and Microsoft 365 group. The security group is the master, so the processing is to add and remove members of the Microsoft 365 group based on the membership of the security group.
I haven’t looked at the article for a long time and was surprised when a reader asked for an updated solution based on Microsoft Graph APIs. The reader supplied some code that they’d written and hadn’t managed to get working, probably because of the somewhat odd way that the Graph APIs return group membership. It’s just one of the foibles developers should understand when they work with the Graph.
Dealing with Group Membership
The documentation for the List Group Members API shows that member identifiers are returned rather than what you might expect, such as a display name or user principal name. This behavior follows through into the Microsoft Graph PowerShell SDK Get-MgGroupMember cmdlet:
Get-MgGroupMember -GroupId $M365Group.Id Id DeletedDateTime -- --------------- eff4cd58-1bb8-4899-94de-795f656b4a18 53f08764-07d4-418c-8403-a737a8fac7b3 6fd89e40-665a-4efa-9691-da07849cae91 …
Dealing with a set of object identifiers isn’t a problem when you expect to do so. However, if you fetch the additionalProperties property, PowerShell returns a hash table containing the expanded details of the group members.
Get-MgGroupMember -GroupId $M365Group.Id | Select-Object -ExpandProperty additionalProperties
Key Value
--- -----
@odata.type #microsoft.graph.user
businessPhones {}
displayName René Artois
givenName René
jobTitle Chief
mail Rene.Artois@office365itpros.com
officeLocation Nouvon
surname Artois
userPrincipalName Rene.Artois@office365itpros.com
@odata.type #microsoft.graph.user
businessPhones {}
displayName Otto Flick
givenName Otto
jobTitle Head of Department
mail Otto.Flick@office365itpros.com
officeLocation Nouvion
surname Flick
userPrincipalName Otto.Flick@office365itpros.com
@odata.type #microsoft.graph.user
businessPhones {+33 4 94301766}
displayName Lotte Vetler (Paris)
givenName Lotte
jobTitle Property Consultant
mail Lotte.Vetler@office365itpros.com
mobilePhone +33 6 7446 1554
officeLocation Flayosc
surname Vetler
userPrincipalName Lotte.Vetler@office365itpros.com
Note that the table doesn’t include the identifier for each user. However, if you create a hash table from additionalProperties, code can use it as a lookup table to extract details for a user identifier. Here’s an example of using the hash table to find the display name for a group member:
[array]$Members = Get-MgGroupMember -GroupId $M365Group.Id
$GroupMembers = $Members | Select-Object -ExpandProperty additionalProperties
[int]$i = 0
ForEach ($M in $Members.Id) {
Write-output ("Processing member {0}" -f $GroupMembers[$i].displayName)
$i++
}
Processing member René Artois
Processing member Otto Flick
Processing member Lotte Vetler (Paris)
Coding a Solution
Once we’re clear about how Graph APIs return group membership, it’s easy to proceed to code and create a replacement script. Unlike the original, which used both the Azure AD and Exchange Online modules, I chose to do everything with the Microsoft Graph PowerShell SDK to avoid the potential for irritating assembly clashes. The code is enhanced a tad with additional checks to make sure that the right kind of groups are involved and to record the additions and removals for the membership of the Microsoft 365 group (Figure 1).

You can download the full script from the Office 365 for IT Pros GitHub repository.
Synchronizing Group Membership Automatically
The technique used in the script is not limited to synchronizing between a security group and a Microsoft 365 group. It could also be used to synchronize the membership of two Microsoft 365 groups or two security groups.
Processes like this are well suited to execution as a scheduled Azure Automation runbook. Running the synchronization job weekly seems like the correct cadence, but I’ll leave it to you to decide.
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.
When a python command is called for the first time, I get “ERROR:root:code for hash blake2b was not found.”
Hello,
When I run MATLAB code that calls Python commands, I get an error message about hash functions.
The following is a shell script called "test_matlab_python.sh":
#!/bin/bash
matlab -nodesktop -nosplash -nodisplay -r "test_matlab_python"
The MATLAB code "test_matlab_python.m" is
clear all;
pe = pyenv(‘Version’,’python3.11′);
res = py.list({‘This’,’is a’,’list’})
exit
When I run the code from a Linux shell, (Fedora Linux version 42)
$ ./test_matlab_python.sh
MATLAB shows an error message:
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2025a Update 1 (25.1.0.2973910) 64-bit (glnxa64)
July 3, 2025
To get started, type doc.
For product information, visit www.mathworks.com.
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2s
res =
Python list with values:
[‘This’, ‘is a’, ‘list’]
Use string, double or cell function to convert to a MATLAB array.
After showing the message, MATLAB works fine. But is there any way not to see this message?
When I run "test_matlab_python.m" from the MATLAB desktop environemnt in the Fedora Linux, the message was not shown in the command window, but it was shown in the shell that started the desktop as follows:
$ matlab
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
…
ValueError: unsupported hash type blake2s
I never saw this message when I was running normal Python programs:
$ python
Python 3.11.14 (main, Oct 10 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list({‘This’,’is a’,’list’})
[‘is a’, ‘This’, ‘list’]
>>>Hello,
When I run MATLAB code that calls Python commands, I get an error message about hash functions.
The following is a shell script called "test_matlab_python.sh":
#!/bin/bash
matlab -nodesktop -nosplash -nodisplay -r "test_matlab_python"
The MATLAB code "test_matlab_python.m" is
clear all;
pe = pyenv(‘Version’,’python3.11′);
res = py.list({‘This’,’is a’,’list’})
exit
When I run the code from a Linux shell, (Fedora Linux version 42)
$ ./test_matlab_python.sh
MATLAB shows an error message:
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2025a Update 1 (25.1.0.2973910) 64-bit (glnxa64)
July 3, 2025
To get started, type doc.
For product information, visit www.mathworks.com.
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2s
res =
Python list with values:
[‘This’, ‘is a’, ‘list’]
Use string, double or cell function to convert to a MATLAB array.
After showing the message, MATLAB works fine. But is there any way not to see this message?
When I run "test_matlab_python.m" from the MATLAB desktop environemnt in the Fedora Linux, the message was not shown in the command window, but it was shown in the shell that started the desktop as follows:
$ matlab
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
…
ValueError: unsupported hash type blake2s
I never saw this message when I was running normal Python programs:
$ python
Python 3.11.14 (main, Oct 10 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list({‘This’,’is a’,’list’})
[‘is a’, ‘This’, ‘list’]
>>> Hello,
When I run MATLAB code that calls Python commands, I get an error message about hash functions.
The following is a shell script called "test_matlab_python.sh":
#!/bin/bash
matlab -nodesktop -nosplash -nodisplay -r "test_matlab_python"
The MATLAB code "test_matlab_python.m" is
clear all;
pe = pyenv(‘Version’,’python3.11′);
res = py.list({‘This’,’is a’,’list’})
exit
When I run the code from a Linux shell, (Fedora Linux version 42)
$ ./test_matlab_python.sh
MATLAB shows an error message:
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2025a Update 1 (25.1.0.2973910) 64-bit (glnxa64)
July 3, 2025
To get started, type doc.
For product information, visit www.mathworks.com.
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2s
res =
Python list with values:
[‘This’, ‘is a’, ‘list’]
Use string, double or cell function to convert to a MATLAB array.
After showing the message, MATLAB works fine. But is there any way not to see this message?
When I run "test_matlab_python.m" from the MATLAB desktop environemnt in the Fedora Linux, the message was not shown in the command window, but it was shown in the shell that started the desktop as follows:
$ matlab
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
…
ValueError: unsupported hash type blake2s
I never saw this message when I was running normal Python programs:
$ python
Python 3.11.14 (main, Oct 10 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list({‘This’,’is a’,’list’})
[‘is a’, ‘This’, ‘list’]
>>> python, hash, blake2b, blake2s MATLAB Answers — New Questions
Ffigure saved as pdf: how to get proper control of margins
Hello,
I want to save a figure as a pdf, and would like to get control on the margins around the figure in the pdf.
Here is an example :
load(‘test_0.mat’); % contains the variables AudioSnip, frameSize, Hop , fs
s_length = length(AudioSnip);
nframes = 1 + floor((s_length – frameSize)/double(Hop ));
UsableSigLength = frameSize + floor(Hop *floor((s_length – frameSize)/double(Hop )));
sampleTime = ( 1: UsableSigLength )/fs;
%$$$$$$$$$$$$$$$$$$$
[B,f,T] = specgram(AudioSnip,frameSize*2,fs,hanning(frameSize), Hop); %(1: UsableSigLength)
B = 20*log10(abs(B));
%
TheFig = figure;
h = gcf ; %gcf returns the current figure handle
h.Units = ‘centimeters’;
h.PaperType= ‘A4’;
h.PaperUnits = ‘centimeters’;
h.PaperOrientation= ‘landscape’; % ‘portrait’;
h.PaperPositionMode= ‘auto’;
h.InvertHardcopy = ‘on’;
h.Renderer = ‘painter’;
margin = 4.; width = 29.7; height = 21.;
h.Position = [margin margin width-2*margin height-2*margin];
h.PaperSize = [29.7 21.0]; %[21.0000 29.7000];
subplot(2,1,1);
plot(sampleTime, AudioSnip(1: UsableSigLength));
xlabel(‘Time (s)’,’FontSize’, 10, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
ylabel(‘Amplitude’, ‘FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
set(get(gca, ‘xlabel’), ‘Position’, [ 21.,-0.21,-1]);
h1 = gcf;
h1.Units = ‘centimeters’;
atx1= gca; % axes ‘Position’, % xtart, ystart xend yend coord
atx1.Position = [0.1300 0.7099 0.6949 0.1635]; %
atx1.FontSize = 10 ; atx1.FontName = ‘Times’; atx1.FontWeight = ‘bold’;
atx1.Units=’normalized’;
Tt0=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.4599 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘String’, ‘text1’);
Tt1=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.260, 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘FontAngle’, ‘italic’,’String’, ‘text2’);
Tt2=text(‘Units’,’normalized’,’Position’,[0.0009 1.0509 0],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,12 , ‘FontWeight’, ‘bold’, ‘String’, ‘text3’);
subplot(2,1,2);
h2 = gcf;
h2.Units = ‘centimeters’;
atx2= gca; % axes(‘Position’, % xtart, ystart xend yend coord
atx2.FontSize = 10; atx2.FontName= ‘Times’ ; atx2.FontWeight = ‘bold’;
atx2.Units=’normalized’;
atx2.Position = [0.1300 0.0720 0.7334 0.5965 ];
imagesc(T,f,B);axis xy;colorbar;
ylabel(‘Frequency (Hz)’,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
xlabel(”,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
colormap jet
exportgraphics(TheFig, ‘outputTest.pdf’);
When I run it,
A) I do not get a proper control on the margins around the figure: the parameter ‘margin’ (see code)does not seem to affect the result in the pdf obtained
What should be done ?
Miscellaneaous other problems:
B) I would like to align the time corresponding to the end of the data (first subplot), with the end of the spectrogram data (2nd subplot): how should this be done ? (I tried some adjustment via axis position, but the colorbar is also messing things up)
C) the font for the 2nd subplot is not the expected ‘Times’; (I tested that it is indeed possible to manually force ‘Times’ using the figure inspector, but not by the program line above (atx2.FontName = ‘Times’)
why ? how to enforce ‘Times’ by programing ?Hello,
I want to save a figure as a pdf, and would like to get control on the margins around the figure in the pdf.
Here is an example :
load(‘test_0.mat’); % contains the variables AudioSnip, frameSize, Hop , fs
s_length = length(AudioSnip);
nframes = 1 + floor((s_length – frameSize)/double(Hop ));
UsableSigLength = frameSize + floor(Hop *floor((s_length – frameSize)/double(Hop )));
sampleTime = ( 1: UsableSigLength )/fs;
%$$$$$$$$$$$$$$$$$$$
[B,f,T] = specgram(AudioSnip,frameSize*2,fs,hanning(frameSize), Hop); %(1: UsableSigLength)
B = 20*log10(abs(B));
%
TheFig = figure;
h = gcf ; %gcf returns the current figure handle
h.Units = ‘centimeters’;
h.PaperType= ‘A4’;
h.PaperUnits = ‘centimeters’;
h.PaperOrientation= ‘landscape’; % ‘portrait’;
h.PaperPositionMode= ‘auto’;
h.InvertHardcopy = ‘on’;
h.Renderer = ‘painter’;
margin = 4.; width = 29.7; height = 21.;
h.Position = [margin margin width-2*margin height-2*margin];
h.PaperSize = [29.7 21.0]; %[21.0000 29.7000];
subplot(2,1,1);
plot(sampleTime, AudioSnip(1: UsableSigLength));
xlabel(‘Time (s)’,’FontSize’, 10, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
ylabel(‘Amplitude’, ‘FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
set(get(gca, ‘xlabel’), ‘Position’, [ 21.,-0.21,-1]);
h1 = gcf;
h1.Units = ‘centimeters’;
atx1= gca; % axes ‘Position’, % xtart, ystart xend yend coord
atx1.Position = [0.1300 0.7099 0.6949 0.1635]; %
atx1.FontSize = 10 ; atx1.FontName = ‘Times’; atx1.FontWeight = ‘bold’;
atx1.Units=’normalized’;
Tt0=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.4599 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘String’, ‘text1’);
Tt1=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.260, 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘FontAngle’, ‘italic’,’String’, ‘text2’);
Tt2=text(‘Units’,’normalized’,’Position’,[0.0009 1.0509 0],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,12 , ‘FontWeight’, ‘bold’, ‘String’, ‘text3’);
subplot(2,1,2);
h2 = gcf;
h2.Units = ‘centimeters’;
atx2= gca; % axes(‘Position’, % xtart, ystart xend yend coord
atx2.FontSize = 10; atx2.FontName= ‘Times’ ; atx2.FontWeight = ‘bold’;
atx2.Units=’normalized’;
atx2.Position = [0.1300 0.0720 0.7334 0.5965 ];
imagesc(T,f,B);axis xy;colorbar;
ylabel(‘Frequency (Hz)’,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
xlabel(”,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
colormap jet
exportgraphics(TheFig, ‘outputTest.pdf’);
When I run it,
A) I do not get a proper control on the margins around the figure: the parameter ‘margin’ (see code)does not seem to affect the result in the pdf obtained
What should be done ?
Miscellaneaous other problems:
B) I would like to align the time corresponding to the end of the data (first subplot), with the end of the spectrogram data (2nd subplot): how should this be done ? (I tried some adjustment via axis position, but the colorbar is also messing things up)
C) the font for the 2nd subplot is not the expected ‘Times’; (I tested that it is indeed possible to manually force ‘Times’ using the figure inspector, but not by the program line above (atx2.FontName = ‘Times’)
why ? how to enforce ‘Times’ by programing ? Hello,
I want to save a figure as a pdf, and would like to get control on the margins around the figure in the pdf.
Here is an example :
load(‘test_0.mat’); % contains the variables AudioSnip, frameSize, Hop , fs
s_length = length(AudioSnip);
nframes = 1 + floor((s_length – frameSize)/double(Hop ));
UsableSigLength = frameSize + floor(Hop *floor((s_length – frameSize)/double(Hop )));
sampleTime = ( 1: UsableSigLength )/fs;
%$$$$$$$$$$$$$$$$$$$
[B,f,T] = specgram(AudioSnip,frameSize*2,fs,hanning(frameSize), Hop); %(1: UsableSigLength)
B = 20*log10(abs(B));
%
TheFig = figure;
h = gcf ; %gcf returns the current figure handle
h.Units = ‘centimeters’;
h.PaperType= ‘A4’;
h.PaperUnits = ‘centimeters’;
h.PaperOrientation= ‘landscape’; % ‘portrait’;
h.PaperPositionMode= ‘auto’;
h.InvertHardcopy = ‘on’;
h.Renderer = ‘painter’;
margin = 4.; width = 29.7; height = 21.;
h.Position = [margin margin width-2*margin height-2*margin];
h.PaperSize = [29.7 21.0]; %[21.0000 29.7000];
subplot(2,1,1);
plot(sampleTime, AudioSnip(1: UsableSigLength));
xlabel(‘Time (s)’,’FontSize’, 10, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
ylabel(‘Amplitude’, ‘FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
set(get(gca, ‘xlabel’), ‘Position’, [ 21.,-0.21,-1]);
h1 = gcf;
h1.Units = ‘centimeters’;
atx1= gca; % axes ‘Position’, % xtart, ystart xend yend coord
atx1.Position = [0.1300 0.7099 0.6949 0.1635]; %
atx1.FontSize = 10 ; atx1.FontName = ‘Times’; atx1.FontWeight = ‘bold’;
atx1.Units=’normalized’;
Tt0=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.4599 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘String’, ‘text1’);
Tt1=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.260, 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘FontAngle’, ‘italic’,’String’, ‘text2’);
Tt2=text(‘Units’,’normalized’,’Position’,[0.0009 1.0509 0],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,12 , ‘FontWeight’, ‘bold’, ‘String’, ‘text3’);
subplot(2,1,2);
h2 = gcf;
h2.Units = ‘centimeters’;
atx2= gca; % axes(‘Position’, % xtart, ystart xend yend coord
atx2.FontSize = 10; atx2.FontName= ‘Times’ ; atx2.FontWeight = ‘bold’;
atx2.Units=’normalized’;
atx2.Position = [0.1300 0.0720 0.7334 0.5965 ];
imagesc(T,f,B);axis xy;colorbar;
ylabel(‘Frequency (Hz)’,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
xlabel(”,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
colormap jet
exportgraphics(TheFig, ‘outputTest.pdf’);
When I run it,
A) I do not get a proper control on the margins around the figure: the parameter ‘margin’ (see code)does not seem to affect the result in the pdf obtained
What should be done ?
Miscellaneaous other problems:
B) I would like to align the time corresponding to the end of the data (first subplot), with the end of the spectrogram data (2nd subplot): how should this be done ? (I tried some adjustment via axis position, but the colorbar is also messing things up)
C) the font for the 2nd subplot is not the expected ‘Times’; (I tested that it is indeed possible to manually force ‘Times’ using the figure inspector, but not by the program line above (atx2.FontName = ‘Times’)
why ? how to enforce ‘Times’ by programing ? pdf, figure, margin MATLAB Answers — New Questions
Hi, why aren’t these circuits working?
The three phase inverter only converts one period.The three phase inverter only converts one period. The three phase inverter only converts one period. #inverter MATLAB Answers — New Questions
GigE Cam works with 2024B but not 2025B
Hello,
I’m currently working with a GigE camera and I tried to update the MATLAB version to 2025B from 2024B.
However after installing the image acquisition toolbox and the GigE adaptor the device can not longer be detected.
I also tested a Point Grey usb camera and it worked fine with 2025B.
Please let me know if you need any other information.
Thanks!Hello,
I’m currently working with a GigE camera and I tried to update the MATLAB version to 2025B from 2024B.
However after installing the image acquisition toolbox and the GigE adaptor the device can not longer be detected.
I also tested a Point Grey usb camera and it worked fine with 2025B.
Please let me know if you need any other information.
Thanks! Hello,
I’m currently working with a GigE camera and I tried to update the MATLAB version to 2025B from 2024B.
However after installing the image acquisition toolbox and the GigE adaptor the device can not longer be detected.
I also tested a Point Grey usb camera and it worked fine with 2025B.
Please let me know if you need any other information.
Thanks! image acquisition, gige camera MATLAB Answers — New Questions
How to Create SharePoint Sites with the Graph API
New Create Site API Fills Gap in Graph Coverage for SharePoint Online
Some big news for SharePoint Online administrators appeared in the Developer Blog on November 24, 2025, with the announcement of a Graph API to create sites. The new API fills in a gap that existed in Graph support for SharePoint Online sites that forced developers to use other methods to create sites, such as the SharePoint REST service (here’s an expanded discussion).
As usual with newly-introduced Graph APIs, the create site API is currently available through the beta Graph endpoint. An equivalent cmdlet in the Microsoft Graph PowerShell SDK is unavailable, but this will come in time after the AutoRest procedure gets to process the metadata for the new API. Given build schedules and the recent holiday period, my best guess is that the cmdlet will appear in V2.35 of the SDK (the current version is 2.34).
Originally, Microsoft said that three templates would be available.
- Group: A team site connected to a Microsoft 365 group.
- Sts: SharePoint Online team site.
- Sitepagepublishing: A publishing or communication site.
However, experience gained in the beta proved that the group template simply didn’t work. Microsoft has decided to withdraw the group template, and all mention of the template will soon disappear from the create Site API documentation. Fortunately, new groups can be created using a variety of other methods, such as the New-MgGroup, New-MgTeam, and New-UnifiedGroup cmdlets.
API Permissions and the Rights to Create Sites
Alongside the create Site API, Microsoft introduced the Sites.Create.All permission. The delegated version of the permission allows the signed-in user to create new sites (if allowed to by the tenant) while the application version allows apps to create new sites without any check. To connect to the Graph and request the scope (permission), use a command like this.
Connect-MgGraph -Scopes Sites.Create.All -NoWelcome
Remember that running Connect-MgGraph interactively creates a session that uses delegated permissions. My account holds the SharePoint administrator role, so I can create new sites without constraint. This might not be the case for every user as the ability to create new sites is governed by SharePoint tenant settings (Figure 1).

The SharePoint admin center setting controls creation of team, publishing, and communication sites.
Using the Create Site Graph API
If your account holds the SharePoint administrator role, you can connect an interactive session to use the API. Alternatively, sign in with an app that has consent to use the Sites.Create.All permission. Lacking a cmdlet to call the API, we’ll use the Invoke-MgGraphRequest cmdlet.
This example shows how to create a new communications site. To create a new team site, change the template from sitepagepublishing to sts.
$Uri = "https://graph.microsoft.com/beta/sites/"
$Params = @{
name = "Corporate Executive Communication"
webUrl = "https://office365itpros.sharepoint.com/sites/CorpExecComms"
locale = "en-US"
shareByEmailEnabled = $false
description = "Communications site for Corporate Executive functions"
template = "sitepagepublishing"
ownerIdentityToResolve = @{
email = "Tony.Redmond@office365itpros.com "
}
}
Invoke-MgGraphRequest -Uri $Uri -Method POST -Body $Params
SharePoint Online doesn’t respond with a status following successful site creation, so to check that everything is good, we must try to retrieve the site.
Get-MgSite -Search "https://office365itpros.sharepoint.com/sites/CorpExecComms"
Because of caching, it takes about ten minutes before the Get-MgSite cmdlet can find the new site. It’s faster to check through the SharePoint admin center! The other thing to remember is that when signing in with your own account, delegated permissions are used and to access the new site, anaccount must be a site owner or member, which is why I included my account as a site owner.
Full Control for App
When a site is created using the API, the calling app receives the Sites.Selected permission with Full.Control access to the new site to enable the app to work with the site. For instance, the app could proceed to add assets like lists, site pages, or documents to the site. Regretfully, there’s no Graph API available to add site members, so this has to be done through the SharePoint admin center or the site (by a site owner).
To demonstrate what happens, I used some code from this article about using the Site.Selected permission to report the permissions for the newly-created communications site. As you can see, the Microsoft Graph PowerShell app has full control:
$Site = Get-MgSite -Search "https://office365itpros.sharepoint.com/sites/CorpExecComms"
[array]$Permissions = Get-MgSitePermission -SiteId $Site.Id
ForEach ($Permission in $Permissions){
$Data = Get-MgSitePermission -PermissionId $Permission.Id -SiteId $Site.Id -Property Id, Roles, GrantedToIdentitiesV2
Write-Host ("{0} permission available to {1}" -f ($Data.Roles -join ","), $Data.GrantedToIdentitiesV2.Application.DisplayName)
}
fullcontrol permission available to Microsoft Graph PowerShell
Microsoft Graph PowerShell is the internal name for the app used for interactive Microsoft Graph PowerShell SDK sessions. The app’s display name is Microsoft Graph Command Line Tools.
A Faltering Start
I’m puzzled why Microsoft pushed out the create Site API. The API doesn’t handle creation of the most common type of SharePoint Online site, and the SharePoint Graph APIs lack the ability to populate site membership. The API is in beta, so Microsoft might address some of the issues raised here by the time you read this article.
I guess the API will allow some organizations to replace current usage of the SharePoint REST API. Aside from that, I don’t see how this API will do much except act as a starting point for SharePoint to fully embrace all aspects of site creation. Time will tell if Microsoft delivers the missing pieces.
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.
symbolic substitution error and convert
syms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted insyms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted in syms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted in mbolic computation MATLAB Answers — New Questions









