Month: October 2025
How can I fit data to a piecewise function, where the breakpoint of the function is also a parameter to be optimised?
I have data with x and y values. This data should conform to a function: an assymmetric parabola. Here, the parameters that define the shape of the parabola should be different on either side of the maximum point of the parabola i.e. the breakpoint is where the maximum value of y occurs.
I was hoping to use ‘fit’ and to define an anonymous function for my data. But I’m not able to work out how to define an anonymous, piecewise function, especially where the breakpoint is one of the parameters to be determined by the fitting procedure, as it is not immediately clear from the data itself where the maximum value of y should occur.
Any help would be appreciated.I have data with x and y values. This data should conform to a function: an assymmetric parabola. Here, the parameters that define the shape of the parabola should be different on either side of the maximum point of the parabola i.e. the breakpoint is where the maximum value of y occurs.
I was hoping to use ‘fit’ and to define an anonymous function for my data. But I’m not able to work out how to define an anonymous, piecewise function, especially where the breakpoint is one of the parameters to be determined by the fitting procedure, as it is not immediately clear from the data itself where the maximum value of y should occur.
Any help would be appreciated. I have data with x and y values. This data should conform to a function: an assymmetric parabola. Here, the parameters that define the shape of the parabola should be different on either side of the maximum point of the parabola i.e. the breakpoint is where the maximum value of y occurs.
I was hoping to use ‘fit’ and to define an anonymous function for my data. But I’m not able to work out how to define an anonymous, piecewise function, especially where the breakpoint is one of the parameters to be determined by the fitting procedure, as it is not immediately clear from the data itself where the maximum value of y should occur.
Any help would be appreciated. curve fitting, optimization MATLAB Answers — New Questions
How to get accurate channel in NTN – TDL model?
Hi,
I’m reading the TDL channel model in the example NR NTN PDSCH Throughput and I have some questions about it, can you explain for me please:
(not my main question, but I am wondering) In the step "Obtain a precoding matrix (wtx) to use in the transmission of the first transport block"
[estChannelGrid,sampleTimes] = HelperNRNTNThroughput.getInitialChannelEstimate(…
carrier,simLocal.NumTransmitAntennas,channel,simLocal.DataType);
in that HelperNRNTNThroughput.getInitialChannelEstimate function, I saw the nrPerfectChannelEstimate function – this is what I am wondering, because I think we just can only estimate the channel, and this step is the estimation for the precoding, how can we do perfect channel estimation? – as I understand, nrPerfectChannelEstimate is the function that we can convert the channel in expression (carrier,pathGains,pathFilters) to the ChannelGrid expression, there is no estimation here.
I checked here and saw that the values of estChannelGrid are in range [0.5, 0.7].
In the step "Perform least squares channel estimation between the received grid and each transmission layer"
[estChannelGrid,noiseEst] = nrChannelEstimate(rxCarrier,rxGrid,…
refDMRSIndices,refDMRSSymbols,’CDMLengths’,pdsch.DMRS.CDMLengths);
I checked the values of estChannelGrid here and saw the values are in range 10^-6 x [3, 7.5].
I saw a line "Apply path loss to the signal" in the second step:
txWaveform = txWaveform*db2mag(-pl_dB(carrier.NSlot+1));
Plathloss here db2mag(-pl_dB(carrier.NSlot+1)) is 1.5678e-08
I want to generate the acurate (perfect) channel in this case, so I tried to multiply the estChannelGrid from nrPerfectChannelEstimate with db2mag(-pl_dB(carrier.NSlot+1)) but the results are in range 10^-9, not 10^-6 (to be near to the estimated channel). – So I am thinking this is not a correct approach to generate the accurate channel.
So my question is, how can I generate the perfect (accurate) channel, so I can compare the estimated channel and the accurate one?
Thank you so muchHi,
I’m reading the TDL channel model in the example NR NTN PDSCH Throughput and I have some questions about it, can you explain for me please:
(not my main question, but I am wondering) In the step "Obtain a precoding matrix (wtx) to use in the transmission of the first transport block"
[estChannelGrid,sampleTimes] = HelperNRNTNThroughput.getInitialChannelEstimate(…
carrier,simLocal.NumTransmitAntennas,channel,simLocal.DataType);
in that HelperNRNTNThroughput.getInitialChannelEstimate function, I saw the nrPerfectChannelEstimate function – this is what I am wondering, because I think we just can only estimate the channel, and this step is the estimation for the precoding, how can we do perfect channel estimation? – as I understand, nrPerfectChannelEstimate is the function that we can convert the channel in expression (carrier,pathGains,pathFilters) to the ChannelGrid expression, there is no estimation here.
I checked here and saw that the values of estChannelGrid are in range [0.5, 0.7].
In the step "Perform least squares channel estimation between the received grid and each transmission layer"
[estChannelGrid,noiseEst] = nrChannelEstimate(rxCarrier,rxGrid,…
refDMRSIndices,refDMRSSymbols,’CDMLengths’,pdsch.DMRS.CDMLengths);
I checked the values of estChannelGrid here and saw the values are in range 10^-6 x [3, 7.5].
I saw a line "Apply path loss to the signal" in the second step:
txWaveform = txWaveform*db2mag(-pl_dB(carrier.NSlot+1));
Plathloss here db2mag(-pl_dB(carrier.NSlot+1)) is 1.5678e-08
I want to generate the acurate (perfect) channel in this case, so I tried to multiply the estChannelGrid from nrPerfectChannelEstimate with db2mag(-pl_dB(carrier.NSlot+1)) but the results are in range 10^-9, not 10^-6 (to be near to the estimated channel). – So I am thinking this is not a correct approach to generate the accurate channel.
So my question is, how can I generate the perfect (accurate) channel, so I can compare the estimated channel and the accurate one?
Thank you so much Hi,
I’m reading the TDL channel model in the example NR NTN PDSCH Throughput and I have some questions about it, can you explain for me please:
(not my main question, but I am wondering) In the step "Obtain a precoding matrix (wtx) to use in the transmission of the first transport block"
[estChannelGrid,sampleTimes] = HelperNRNTNThroughput.getInitialChannelEstimate(…
carrier,simLocal.NumTransmitAntennas,channel,simLocal.DataType);
in that HelperNRNTNThroughput.getInitialChannelEstimate function, I saw the nrPerfectChannelEstimate function – this is what I am wondering, because I think we just can only estimate the channel, and this step is the estimation for the precoding, how can we do perfect channel estimation? – as I understand, nrPerfectChannelEstimate is the function that we can convert the channel in expression (carrier,pathGains,pathFilters) to the ChannelGrid expression, there is no estimation here.
I checked here and saw that the values of estChannelGrid are in range [0.5, 0.7].
In the step "Perform least squares channel estimation between the received grid and each transmission layer"
[estChannelGrid,noiseEst] = nrChannelEstimate(rxCarrier,rxGrid,…
refDMRSIndices,refDMRSSymbols,’CDMLengths’,pdsch.DMRS.CDMLengths);
I checked the values of estChannelGrid here and saw the values are in range 10^-6 x [3, 7.5].
I saw a line "Apply path loss to the signal" in the second step:
txWaveform = txWaveform*db2mag(-pl_dB(carrier.NSlot+1));
Plathloss here db2mag(-pl_dB(carrier.NSlot+1)) is 1.5678e-08
I want to generate the acurate (perfect) channel in this case, so I tried to multiply the estChannelGrid from nrPerfectChannelEstimate with db2mag(-pl_dB(carrier.NSlot+1)) but the results are in range 10^-9, not 10^-6 (to be near to the estimated channel). – So I am thinking this is not a correct approach to generate the accurate channel.
So my question is, how can I generate the perfect (accurate) channel, so I can compare the estimated channel and the accurate one?
Thank you so much ntn, channel estimation, tdl channel MATLAB Answers — New Questions
Why does the Moist Air Local Restriction create vastly different mass flow results when compared to the Gas Local Restriction?
I have set up 2 identical models in Simulink/Simscape Moist Air and Gas in R2022a.
For Moist Air: Controlled Reservoir to Local Restriction to Controlled Reservoir.
For Gas: Reservoir to Local Restriction to Reservoir.
I set the upstream conditions to 14.7 psi, 70 F for both. For Moist Air, i set Trace Gas and Humidity to 0. Down stream is set to 14.65488601 psi and 70F. The area of each Local Restriction is set to 7 in^2. The Cd is set to 1. Min / Max constrictioins are set to 1e-10 and 20 in^2 respectively. The Cross-sectional area at ports A and B is set to 21 in^2. The Upstream / Downstream Resevoir Cross-sectional areas are port A are set to 100 in^2.
I am using PS-Simulink Converters to get lbm/min as the unit from each downstream mass flow sensor.
I am using PS-Simulink Converters to go from a text box with 7 to in^2 to go into the AR port of the local restrictions for both models.
For Moist Air, i get 52.5 lbm/min, for Gas i get 15.04 lbm/min. I have an Excel based hand calc for orifices using basic isentropic relations and get 16.29 lbm/min, much closer to the Gas result.
What is going on with the Moist Air results? I am using the default perfect gas values in the Gas properties block and Air in the Moist Air block. The parameters don’t seeem too different, no where near enough to result in the differences seen below.I have set up 2 identical models in Simulink/Simscape Moist Air and Gas in R2022a.
For Moist Air: Controlled Reservoir to Local Restriction to Controlled Reservoir.
For Gas: Reservoir to Local Restriction to Reservoir.
I set the upstream conditions to 14.7 psi, 70 F for both. For Moist Air, i set Trace Gas and Humidity to 0. Down stream is set to 14.65488601 psi and 70F. The area of each Local Restriction is set to 7 in^2. The Cd is set to 1. Min / Max constrictioins are set to 1e-10 and 20 in^2 respectively. The Cross-sectional area at ports A and B is set to 21 in^2. The Upstream / Downstream Resevoir Cross-sectional areas are port A are set to 100 in^2.
I am using PS-Simulink Converters to get lbm/min as the unit from each downstream mass flow sensor.
I am using PS-Simulink Converters to go from a text box with 7 to in^2 to go into the AR port of the local restrictions for both models.
For Moist Air, i get 52.5 lbm/min, for Gas i get 15.04 lbm/min. I have an Excel based hand calc for orifices using basic isentropic relations and get 16.29 lbm/min, much closer to the Gas result.
What is going on with the Moist Air results? I am using the default perfect gas values in the Gas properties block and Air in the Moist Air block. The parameters don’t seeem too different, no where near enough to result in the differences seen below. I have set up 2 identical models in Simulink/Simscape Moist Air and Gas in R2022a.
For Moist Air: Controlled Reservoir to Local Restriction to Controlled Reservoir.
For Gas: Reservoir to Local Restriction to Reservoir.
I set the upstream conditions to 14.7 psi, 70 F for both. For Moist Air, i set Trace Gas and Humidity to 0. Down stream is set to 14.65488601 psi and 70F. The area of each Local Restriction is set to 7 in^2. The Cd is set to 1. Min / Max constrictioins are set to 1e-10 and 20 in^2 respectively. The Cross-sectional area at ports A and B is set to 21 in^2. The Upstream / Downstream Resevoir Cross-sectional areas are port A are set to 100 in^2.
I am using PS-Simulink Converters to get lbm/min as the unit from each downstream mass flow sensor.
I am using PS-Simulink Converters to go from a text box with 7 to in^2 to go into the AR port of the local restrictions for both models.
For Moist Air, i get 52.5 lbm/min, for Gas i get 15.04 lbm/min. I have an Excel based hand calc for orifices using basic isentropic relations and get 16.29 lbm/min, much closer to the Gas result.
What is going on with the Moist Air results? I am using the default perfect gas values in the Gas properties block and Air in the Moist Air block. The parameters don’t seeem too different, no where near enough to result in the differences seen below. simulink, moist air, gas, mass flow, local restriction, simscape MATLAB Answers — New Questions
I am plotting a lot of surfaces, and the code is very slow, is there a faster/ more efficient way to plot this in a 3d graph?
I am currently plotting 150 surfaces of 550 by 550. This is very slow in rendering and loading.
axis_images= handles.figure.CurrentAxes;
for k=1:length(slices) %plots the registration slices
%the next line makes a great big box, handles, which contains all the
%plot data, but in a cell array so must be refrenced by using handles.plot{1}
%instead of handles.plot1 or handles.plot(1)
hold on
handles.registration_slices{k}= surf(X,Y,Z.*(slices(k)), …
‘CData’,image(:,:,:,k,:), ‘CDataMapping’,’direct’, …
‘EdgeColor’,’none’, ‘FaceColor’, ‘texturemap’, …
‘FaceAlpha’,’texturemap’,’AlphaData’,masks(:,:,:,k));
%FaceColor determines the color with the data in Cdata
%FaceAlpha determines the opacity of a given slice based on the
%texturemap given in AlphaData
end
freezeColors;
view(3), box on, %axis tight square
pause(1);
for i = 1:size(atlas_slices,3) %creates the atlas masks
atlas_mask=atlas_slices(:,:,i);
atlas_mask(atlas_mask<=50)=0;
atlas_mask(atlas_mask>50)=120;
atlas_masks=cat(4,atlas_masks,atlas_mask);
end
% Y_scaled=scale(Y,atlas_scale);
for k=1:length(slices) %plots the atlas slices
hold on
handles.atlas_slices{k}=surf(X+Atlas_x_correction,Y+Atlas_y_correction,Z.*(slices(k)-0.5), …
‘CData’,atlas_slices(:,:,k), ‘CDataMapping’,’direct’, …
‘EdgeColor’,’none’,’FaceColor’, ‘texturemap’, …
‘FaceAlpha’,’texturemap’,’AlphaData’,atlas_masks(:,:,:,k));
end
colormap(handles.figure.CurrentAxes, gray);
%axis equal;
%axis(axis_atlas,’off’)I am currently plotting 150 surfaces of 550 by 550. This is very slow in rendering and loading.
axis_images= handles.figure.CurrentAxes;
for k=1:length(slices) %plots the registration slices
%the next line makes a great big box, handles, which contains all the
%plot data, but in a cell array so must be refrenced by using handles.plot{1}
%instead of handles.plot1 or handles.plot(1)
hold on
handles.registration_slices{k}= surf(X,Y,Z.*(slices(k)), …
‘CData’,image(:,:,:,k,:), ‘CDataMapping’,’direct’, …
‘EdgeColor’,’none’, ‘FaceColor’, ‘texturemap’, …
‘FaceAlpha’,’texturemap’,’AlphaData’,masks(:,:,:,k));
%FaceColor determines the color with the data in Cdata
%FaceAlpha determines the opacity of a given slice based on the
%texturemap given in AlphaData
end
freezeColors;
view(3), box on, %axis tight square
pause(1);
for i = 1:size(atlas_slices,3) %creates the atlas masks
atlas_mask=atlas_slices(:,:,i);
atlas_mask(atlas_mask<=50)=0;
atlas_mask(atlas_mask>50)=120;
atlas_masks=cat(4,atlas_masks,atlas_mask);
end
% Y_scaled=scale(Y,atlas_scale);
for k=1:length(slices) %plots the atlas slices
hold on
handles.atlas_slices{k}=surf(X+Atlas_x_correction,Y+Atlas_y_correction,Z.*(slices(k)-0.5), …
‘CData’,atlas_slices(:,:,k), ‘CDataMapping’,’direct’, …
‘EdgeColor’,’none’,’FaceColor’, ‘texturemap’, …
‘FaceAlpha’,’texturemap’,’AlphaData’,atlas_masks(:,:,:,k));
end
colormap(handles.figure.CurrentAxes, gray);
%axis equal;
%axis(axis_atlas,’off’) I am currently plotting 150 surfaces of 550 by 550. This is very slow in rendering and loading.
axis_images= handles.figure.CurrentAxes;
for k=1:length(slices) %plots the registration slices
%the next line makes a great big box, handles, which contains all the
%plot data, but in a cell array so must be refrenced by using handles.plot{1}
%instead of handles.plot1 or handles.plot(1)
hold on
handles.registration_slices{k}= surf(X,Y,Z.*(slices(k)), …
‘CData’,image(:,:,:,k,:), ‘CDataMapping’,’direct’, …
‘EdgeColor’,’none’, ‘FaceColor’, ‘texturemap’, …
‘FaceAlpha’,’texturemap’,’AlphaData’,masks(:,:,:,k));
%FaceColor determines the color with the data in Cdata
%FaceAlpha determines the opacity of a given slice based on the
%texturemap given in AlphaData
end
freezeColors;
view(3), box on, %axis tight square
pause(1);
for i = 1:size(atlas_slices,3) %creates the atlas masks
atlas_mask=atlas_slices(:,:,i);
atlas_mask(atlas_mask<=50)=0;
atlas_mask(atlas_mask>50)=120;
atlas_masks=cat(4,atlas_masks,atlas_mask);
end
% Y_scaled=scale(Y,atlas_scale);
for k=1:length(slices) %plots the atlas slices
hold on
handles.atlas_slices{k}=surf(X+Atlas_x_correction,Y+Atlas_y_correction,Z.*(slices(k)-0.5), …
‘CData’,atlas_slices(:,:,k), ‘CDataMapping’,’direct’, …
‘EdgeColor’,’none’,’FaceColor’, ‘texturemap’, …
‘FaceAlpha’,’texturemap’,’AlphaData’,atlas_masks(:,:,:,k));
end
colormap(handles.figure.CurrentAxes, gray);
%axis equal;
%axis(axis_atlas,’off’) surf, optimization MATLAB Answers — New Questions
Microsoft Introduces Restore Capability for Conditional Access Policies
Restore a Conditional Access Policy Only Possible via Graph Requests For Now
Documented but not announced, the beta endpoint for the Microsoft Graph conditionalAccessPolicy resource now supports an API to restore soft-deleted conditional access policies. The restore API is used alongside the API to list soft-deleted objects used with conditional access policies. The APIs are relatively new and have not yet shown up in the Entra admin center, which currently issues a solemn warning if an administrator deletes a conditional access policy (Figure 1).

Finding Soft-deleted Conditional Access Policies
The code to discover if a tenant has any soft-deleted conditional access policies is straightforward. Because the API is relatively new, a cmdlet is not yet available in the Microsoft Graph PowerShell SDK (V2.31). No doubt a cmdlet will appear in a future version.
To discover if any soft-deleted conditional access policies exist, we execute the Invoke-MgGraphRequest cmdlet to run a HTTP request against the API and examine the details of what the API returns. The Policy.Read.ConditionalAccess permission must be available to the interactive session and the signed-in user must hold a suitable Entra role such as Conditional Access administrator or Security administrator.
$Uri = 'https://graph.microsoft.com/beta/identity/conditionalAccess/deletedItems/policies' $Data = Invoke-MgGraphRequest -Uri $Uri -Method Get -OutputType PSObject | Select-Object -ExpandProperty Value If ($Data) { Write-Host "" Write-Host ("{0} soft-deleted conditional access policies found" -f $Data.count) Write-Host "" $Data | Format-Table Id, displayName, createdDateTime, deletedDateTime } Else { Write-Host "No soft-deleted conditional access policies found to restore" } 1 soft-deleted conditional access policies found id displayName createdDateTime deletedDateTime -- ----------- --------------- --------------- 14786eef-facd-41ac-83e6-19b317d3e054 Strong MFA for Hard Deletions 05/02/2025 14:05:07 02/10/2025 17:01:05
The output shows that the API found a soft-deleted conditional access policy. Like other Entra ID soft-deleted objects, conditional access policies remain in the soft-deleted state after deletion. When the retention period expires, Entra removes the policy object permanently and it is no longer recoverable.
Restore a Soft-Deleted Conditional Access Policy
Restoring a soft-deleted conditional access policy requires the Policy.ReadWrite.ConditionalAccess permission. The signed-in user must also hold a suitable RBAC role as described above. This example selects the first item in an array of soft-deleted policies returned using the first example, creates the URL to restore the policy, and executes the request to restore the soft-deleted conditional access policy. A successful restore populates the variable used to accept the output of the Invoke-MgGraphRequest cmdlet, so the code checks the variable to make sure that the restore worked:
$PolicyId = $Data[0].Id $RestoredPolicy = $null $Uri = ("https://graph.microsoft.com/beta/identity/conditionalAccess/deletedItems/policies/{0}/restore" -f $PolicyId) Try { $RestoredPolicy = Invoke-MgGraphRequest -Uri $Uri -Method Post -ErrorAction Stop } Catch { Write-Host ("Error restoring conditional access policy {0}" -f $PolicyId) } If ($RestoredPolicy) { Write-Host ("Successfully restored soft-deleted {0} conditional access policy" -f $RestoredPolicy.displayName) }
Another way to check that the restore worked is to run the Get-MgIdentityConditionalAccessPolicy cmdlet:
$Check = Get-MgIdentityConditionalAccessPolicy -ConditionalAccessPolicyId $RestoredPolicy.id If ($Check) {Write-Host "Restore worked!"}
The newly restored policy will be visible in the Entra admin center the next time the Conditional Access Policies page refreshes.
Permanently Remove a Soft-Deleted Conditional Access Policy
If necessary, soft-deleted policies can be removed before the 30-day retention period expires with the delete policyDeleteItem API. Once again, the example uses the first item in an array of soft-deleted policies.
$PolicyId = $Data[0].Id $Uri = ("https://graph.microsoft.com/beta/identity/conditionalAccess/deletedItems/policies/{0}" -f $PolicyId) Try { Invoke-MgGraphRequest -Uri $Uri -Method Delete -ErrorAction Stop } Catch { Write-Host ("Failed to remove soft-deleted policy {0}" -f $PolicyId) }
Recovery Options are Always Good
It’s always good to have a get out of jail card that allows the recovery of items deleted in error and the new restore capabilities are a good addition to the PowerShell cmdlets for managing conditional access policies.
I’m not sure how many administrators delete conditional access policies instead of first disabling unwanted policies for a period of a week or so before proceeding to deletion. That’s still the best way of removing conditional access policies from a tenant because everything can be done through the Entra admin center. However, Microsoft has some AI-powered Entra administrative agents in preview. The current set of agents includes the conditional access optimization agent, which is designed to analyze and optimize the conditional access policies found in a tenant, including:
The agent also evaluates all existing enabled policies to propose potential consolidation of similar policies. When the agent identifies a suggestion, you can have the agent update the associated policy with one click-remediation.
If the conditional access optimization agent recommends consolidation into a smaller set of policies, it probably will result in the removal of some policies that are no longer required. Administrators click to action the agent’s recommendations. It’s good to know that if the agent proposes the removal of some policies that should be kept, at least administrators can recover the deleted policies if they go ahead with “one-click remediation.”
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.
Extracting data from .txt file
Hi,
I have two files (Text files) named as Force.txt and Disp.txt. I want to extracct data from these two files and plot a graph where force value will be on the Y axis and Displacement Values will be on the X axis. In the text files I have data of step numbers ( There are total 89 steps). In file disp.txt, thre are 89 values of displacement for 89 steps and it is obtained from node no. 1964.
On the other hand, the force values will be for nodes 1-3 7-10 73-76 342-346 447-451 982-984 988-991 1054-1057 1323-1327 1428-1432 1963 1965-1968 1973-1976 2242-2246 2287-2291 2822-3593 (total 833 nodes) and for 89 steps. I have attached the files with this question.
I want to extract data like the following table: Then want to plot a graph as mentioned above.
Force ( summed value of 833 nodes) Disp.(for node 1964)
Step 1 ***** *****
Step 2 **** ****
Step 3 ***** ****
Step 4 ***** ****
Step 5 ***** ****
……
Step 89 ***** ****
Can anyone help me in writing a matlab code? I would appreciate your kind assistance.
Thank you in advance.Hi,
I have two files (Text files) named as Force.txt and Disp.txt. I want to extracct data from these two files and plot a graph where force value will be on the Y axis and Displacement Values will be on the X axis. In the text files I have data of step numbers ( There are total 89 steps). In file disp.txt, thre are 89 values of displacement for 89 steps and it is obtained from node no. 1964.
On the other hand, the force values will be for nodes 1-3 7-10 73-76 342-346 447-451 982-984 988-991 1054-1057 1323-1327 1428-1432 1963 1965-1968 1973-1976 2242-2246 2287-2291 2822-3593 (total 833 nodes) and for 89 steps. I have attached the files with this question.
I want to extract data like the following table: Then want to plot a graph as mentioned above.
Force ( summed value of 833 nodes) Disp.(for node 1964)
Step 1 ***** *****
Step 2 **** ****
Step 3 ***** ****
Step 4 ***** ****
Step 5 ***** ****
……
Step 89 ***** ****
Can anyone help me in writing a matlab code? I would appreciate your kind assistance.
Thank you in advance. Hi,
I have two files (Text files) named as Force.txt and Disp.txt. I want to extracct data from these two files and plot a graph where force value will be on the Y axis and Displacement Values will be on the X axis. In the text files I have data of step numbers ( There are total 89 steps). In file disp.txt, thre are 89 values of displacement for 89 steps and it is obtained from node no. 1964.
On the other hand, the force values will be for nodes 1-3 7-10 73-76 342-346 447-451 982-984 988-991 1054-1057 1323-1327 1428-1432 1963 1965-1968 1973-1976 2242-2246 2287-2291 2822-3593 (total 833 nodes) and for 89 steps. I have attached the files with this question.
I want to extract data like the following table: Then want to plot a graph as mentioned above.
Force ( summed value of 833 nodes) Disp.(for node 1964)
Step 1 ***** *****
Step 2 **** ****
Step 3 ***** ****
Step 4 ***** ****
Step 5 ***** ****
……
Step 89 ***** ****
Can anyone help me in writing a matlab code? I would appreciate your kind assistance.
Thank you in advance. extract data MATLAB Answers — New Questions
Arithmetic coding increases sequence length
Hi all,
I’m using the function "arithenco(seq,counts)" to compress a sequence of 1’s,2’s,3’s and 4’s of size 65536. The correspondent counts (number of occurrences for each symbol) is [1991,7759,52117,3669] so the symbol 3 shows an high probability to occur and I would expect a compression gain from the arithmetic code. But this doesn’t happen, and the function outputs a code of size 66424 (longer than the original), how is possible?
Thank you for the attention.Hi all,
I’m using the function "arithenco(seq,counts)" to compress a sequence of 1’s,2’s,3’s and 4’s of size 65536. The correspondent counts (number of occurrences for each symbol) is [1991,7759,52117,3669] so the symbol 3 shows an high probability to occur and I would expect a compression gain from the arithmetic code. But this doesn’t happen, and the function outputs a code of size 66424 (longer than the original), how is possible?
Thank you for the attention. Hi all,
I’m using the function "arithenco(seq,counts)" to compress a sequence of 1’s,2’s,3’s and 4’s of size 65536. The correspondent counts (number of occurrences for each symbol) is [1991,7759,52117,3669] so the symbol 3 shows an high probability to occur and I would expect a compression gain from the arithmetic code. But this doesn’t happen, and the function outputs a code of size 66424 (longer than the original), how is possible?
Thank you for the attention. arithmetic code, compression, signal processing, data, image processing, code MATLAB Answers — New Questions
Legend not exported when position is set to “best”
I’m creating a figure with plot and legend and I set the legend’s position to "best" like this:
legend("…", Location="best")
After exporting:
exportgraphics(f, fullfile(opts.output_path,fig_name), ‘Resolution’, 300);
The legend is not on the figure.
If I set the location to someting else, like "southwest", it works.
Does anyone know if there is a solution to this?
Thanks!I’m creating a figure with plot and legend and I set the legend’s position to "best" like this:
legend("…", Location="best")
After exporting:
exportgraphics(f, fullfile(opts.output_path,fig_name), ‘Resolution’, 300);
The legend is not on the figure.
If I set the location to someting else, like "southwest", it works.
Does anyone know if there is a solution to this?
Thanks! I’m creating a figure with plot and legend and I set the legend’s position to "best" like this:
legend("…", Location="best")
After exporting:
exportgraphics(f, fullfile(opts.output_path,fig_name), ‘Resolution’, 300);
The legend is not on the figure.
If I set the location to someting else, like "southwest", it works.
Does anyone know if there is a solution to this?
Thanks! figure, legend, exportgrapics MATLAB Answers — New Questions
How can I use sqlwrite with backgroundPool?
I am receiving real-time data and saving the data to a MS SQL Server database using sqlwrite with no problem. I want to run this on the backgroundPool to ensure the main thread remains responsive to user input. I have Parallel Computing Toolbox and a JDBC connection object that reads and writes to the MS SQL Server database with no issue.
However, when I create a parallel.pool.Constant object and pass it to parfeval, the connection object fails the check for a valid connection (~isopen(conn)) that is found in both sqlwrite (line 56) and fetch (line 69).
conn = database( … );
bgConn = parallel.pool.Constant(conn);
f = parfeval(backgroundPool,@(c)isopen(c.Value),1,bgConn);
disp([‘Bg Pool // ConnIsOpen: ‘ num2str(fetchOutputs(f))]);
returns
Bg Pool // ConnIsOpen: 0
If I try a function handle, I get a different error message.
fhConn = @()database( … );
bgFhConn = parallel.pool.Constant(fhConn);
f = parfeval(backgroundPool,@(c)isopen(c.Value),1,bgFhConn);
disp([‘Bg Pool // ConnIsOpen: ‘ num2str(fetchOutputs(f))]);
returns
One or more futures resulted in an error.
Caused by:
Error using parallel.pool.Constant/get.Value (line 188)
Unable to create parallel.pool.Constant on the workers.
Unable to resolve the name ‘com.mathworks.jmi.ClassLoaderManager.getClassLoaderManager’.
How can I use parfeval to run sqlwrite? I see the same behaviour in both MATLAB 2024a and 2025a. Thanks for your help.I am receiving real-time data and saving the data to a MS SQL Server database using sqlwrite with no problem. I want to run this on the backgroundPool to ensure the main thread remains responsive to user input. I have Parallel Computing Toolbox and a JDBC connection object that reads and writes to the MS SQL Server database with no issue.
However, when I create a parallel.pool.Constant object and pass it to parfeval, the connection object fails the check for a valid connection (~isopen(conn)) that is found in both sqlwrite (line 56) and fetch (line 69).
conn = database( … );
bgConn = parallel.pool.Constant(conn);
f = parfeval(backgroundPool,@(c)isopen(c.Value),1,bgConn);
disp([‘Bg Pool // ConnIsOpen: ‘ num2str(fetchOutputs(f))]);
returns
Bg Pool // ConnIsOpen: 0
If I try a function handle, I get a different error message.
fhConn = @()database( … );
bgFhConn = parallel.pool.Constant(fhConn);
f = parfeval(backgroundPool,@(c)isopen(c.Value),1,bgFhConn);
disp([‘Bg Pool // ConnIsOpen: ‘ num2str(fetchOutputs(f))]);
returns
One or more futures resulted in an error.
Caused by:
Error using parallel.pool.Constant/get.Value (line 188)
Unable to create parallel.pool.Constant on the workers.
Unable to resolve the name ‘com.mathworks.jmi.ClassLoaderManager.getClassLoaderManager’.
How can I use parfeval to run sqlwrite? I see the same behaviour in both MATLAB 2024a and 2025a. Thanks for your help. I am receiving real-time data and saving the data to a MS SQL Server database using sqlwrite with no problem. I want to run this on the backgroundPool to ensure the main thread remains responsive to user input. I have Parallel Computing Toolbox and a JDBC connection object that reads and writes to the MS SQL Server database with no issue.
However, when I create a parallel.pool.Constant object and pass it to parfeval, the connection object fails the check for a valid connection (~isopen(conn)) that is found in both sqlwrite (line 56) and fetch (line 69).
conn = database( … );
bgConn = parallel.pool.Constant(conn);
f = parfeval(backgroundPool,@(c)isopen(c.Value),1,bgConn);
disp([‘Bg Pool // ConnIsOpen: ‘ num2str(fetchOutputs(f))]);
returns
Bg Pool // ConnIsOpen: 0
If I try a function handle, I get a different error message.
fhConn = @()database( … );
bgFhConn = parallel.pool.Constant(fhConn);
f = parfeval(backgroundPool,@(c)isopen(c.Value),1,bgFhConn);
disp([‘Bg Pool // ConnIsOpen: ‘ num2str(fetchOutputs(f))]);
returns
One or more futures resulted in an error.
Caused by:
Error using parallel.pool.Constant/get.Value (line 188)
Unable to create parallel.pool.Constant on the workers.
Unable to resolve the name ‘com.mathworks.jmi.ClassLoaderManager.getClassLoaderManager’.
How can I use parfeval to run sqlwrite? I see the same behaviour in both MATLAB 2024a and 2025a. Thanks for your help. backgroundpool, sqlwrite, fetch, database, jdbc MATLAB Answers — New Questions
Teams Stamps External Users with Trust Indicators
Trust Indicators Indicate the Level of Trust in External Users
Unfortunately, social engineering attacks designed to confuse and trick unwary users into doing something that leads to account compromise (and potentially to tenant compromise) continue unabated. According to the last number for monthly active users provided by Microsoft, 320 million people use Teams. That audience represents an attractive target for attackers to go after, and many of the social engineering attacks occur through federated chats from unknown externals users.
The original design for Teams envisaged an open collaborative environment where Teams users from Microsoft 365 domains could connect to Teams users in other domains. Attackers duly signed up trial tenants and used trial Teams licenses to reach out and attempt to connect with targets. Given that the SIP address for most Microsoft 365 users is the same as their primary SMTP address, once an attacker has an email address, they can try to institute a federated chat to that address and hope that the person at the other end responds.
Visual Clues About the Trustability of External Users
Microsoft clamped down on the ability of trial tenants to use federated chat in 2024. But attackers adapt to changed circumstances and keep on trying. This brings us to the announcement of trust indicators for Teams users published in MC1162276 (29 September 2025). Like the external tag applied to email from external sources, a trust indicator is a badge displayed alongside an external user’s name to give tenant users a visual clue about their status.
Public preview for trusted indicators has already started and is expected to be completed in late November. General availability will then roll out the feature to all tenants in all clouds for completion in early January 2026. The documentation for trust indicators describes the different badges used by Teams and where the badges appear, so I won’t go into the details here. However, here are some examples of where you’ll probably see trust indicators in action.
First, Figure 1 shows the participant list for a group chat. I’m a guest user in this chat and the badge and tooltip show that status. A guest user has a high level of trust because they are using an account added to the tenant directory to access Teams. Some might argue that this really doesn’t indicate a high level of trust because guests can be added to the tenant directory without administrative oversight. For example, by sharing a document with an external user.

Figure 2 shows another important point. In this case, we’re viewing the membership of a team and two of the members have no trust indicators. This is because they’re tenant members, so their status makes these members very trustworthy.

Build an Allow List for Teams Communications
Trust indicators are a nice addition to Teams, but I fear that they don’t address an issue that many Microsoft 365 tenants ignore, and that’s the need to control external access for Teams. I accept that it’s nice to be open and collaborative and willing to communicate with anyone in any tenant, but I also consider this to be a dangerous approach to use without question. An open tenant is an invitation to connect, but that allows unwanted visitors to attempt to connect to users.
Tenants can control the tenants that users are allowed to communicate with by establishing an external access allow list. You can build an allow list manually, but it can be difficult to know all the domains that people wish to use. It’s possible to construct the allow list programmatically with PowerShell using sources like the home domains for guest accounts or federated chats with external people. Either source is a good start for an allow list that can then be tweaked to add whatever domains are missing.
The downside of using an allow list to control Teams external access is that anytime someone wants to connect with a user in a domain that’s not in the allow list, they must seek approval for the addition of that domain. That’s regrettable, but it might be better than allowing external connections from any other Microsoft 365 domain, including those controlled by the bad guys.
Small but Important Step
Trust indicators are a small but important step to help Teams users recognize the status of external collaborators. It’s good to have these visual clues, and I hope that the clues help users to be more wary in their external communications. However, maybe it’s even better to close off the holes in Teams external access where undesirable connections can creep in.
Support the work of the Office 365 for IT Pros team by subscribing to the Office 365 for IT Pros eBook. Your support pays for the time we need to track, analyze, and document the changing world of Microsoft 365 and Office 365. Only humans contribute to our work!
30 days test version for learning
Hello, I would like to install test version of MAtlab for my personal training, however before I install it is asking me to write my company name. the thing is I am not working anywhere, I dont have a company. what shall I do? how can I test the Matlab? Thanks a lot!Hello, I would like to install test version of MAtlab for my personal training, however before I install it is asking me to write my company name. the thing is I am not working anywhere, I dont have a company. what shall I do? how can I test the Matlab? Thanks a lot! Hello, I would like to install test version of MAtlab for my personal training, however before I install it is asking me to write my company name. the thing is I am not working anywhere, I dont have a company. what shall I do? how can I test the Matlab? Thanks a lot! trial, matlab, test version MATLAB Answers — New Questions
Issue with XCP on CAN (F2838x – Simulink External Mode)
Dear MathWorks Team,
I am currently programming a TI F2838x processor using Simulink. For External Mode, I am using XCP on CAN and have selected the CAN-A module.
However, CAN-A is not solely used for XCP communication — I also use it for standard CAN communication with different message IDs. XCP works as expected, and I can monitor variable values via the A2L file without any issues. That said, I have encountered an intermittent issue on the CAN bus: occasionally (approximately every 2 hours), a message appears with the same CAN ID as one of my existing fixed-length (8-byte) messages, but with a different data length.
This behavior should not occur under normal circumstances. I have reviewed my XCP configuration and everything appears to be correctly set up. Additionally, I have ensured that no mailbox number conflicts exist between the XCP configuration and my other CAN messages.
I would appreciate any insights or suggestions as to what might be causing this unexpected behavior. Has anyone encountered a similar issue, or is there any known limitation or configuration detail that I might be overlooking?
Thank you in advance for your support.Dear MathWorks Team,
I am currently programming a TI F2838x processor using Simulink. For External Mode, I am using XCP on CAN and have selected the CAN-A module.
However, CAN-A is not solely used for XCP communication — I also use it for standard CAN communication with different message IDs. XCP works as expected, and I can monitor variable values via the A2L file without any issues. That said, I have encountered an intermittent issue on the CAN bus: occasionally (approximately every 2 hours), a message appears with the same CAN ID as one of my existing fixed-length (8-byte) messages, but with a different data length.
This behavior should not occur under normal circumstances. I have reviewed my XCP configuration and everything appears to be correctly set up. Additionally, I have ensured that no mailbox number conflicts exist between the XCP configuration and my other CAN messages.
I would appreciate any insights or suggestions as to what might be causing this unexpected behavior. Has anyone encountered a similar issue, or is there any known limitation or configuration detail that I might be overlooking?
Thank you in advance for your support. Dear MathWorks Team,
I am currently programming a TI F2838x processor using Simulink. For External Mode, I am using XCP on CAN and have selected the CAN-A module.
However, CAN-A is not solely used for XCP communication — I also use it for standard CAN communication with different message IDs. XCP works as expected, and I can monitor variable values via the A2L file without any issues. That said, I have encountered an intermittent issue on the CAN bus: occasionally (approximately every 2 hours), a message appears with the same CAN ID as one of my existing fixed-length (8-byte) messages, but with a different data length.
This behavior should not occur under normal circumstances. I have reviewed my XCP configuration and everything appears to be correctly set up. Additionally, I have ensured that no mailbox number conflicts exist between the XCP configuration and my other CAN messages.
I would appreciate any insights or suggestions as to what might be causing this unexpected behavior. Has anyone encountered a similar issue, or is there any known limitation or configuration detail that I might be overlooking?
Thank you in advance for your support. xcp on can, simulink, f2838x, c2000, externalmode MATLAB Answers — New Questions
how to debug s functions in Matlab
how to debug an s function ,wrapper code and a mex filehow to debug an s function ,wrapper code and a mex file how to debug an s function ,wrapper code and a mex file debug s function MATLAB Answers — New Questions
impossible to launch matlab 2025b
I have installed the R2025b release but when I launch the programm it doesn’t strat.
I have only a white screen with matlab logo but nothing more.
I’ve tried to reinstall the program but nothing happen.
I have the R2023B version and it works very well
Thanks
SergioI have installed the R2025b release but when I launch the programm it doesn’t strat.
I have only a white screen with matlab logo but nothing more.
I’ve tried to reinstall the program but nothing happen.
I have the R2023B version and it works very well
Thanks
Sergio I have installed the R2025b release but when I launch the programm it doesn’t strat.
I have only a white screen with matlab logo but nothing more.
I’ve tried to reinstall the program but nothing happen.
I have the R2023B version and it works very well
Thanks
Sergio launch issue MATLAB Answers — New Questions
Accelerating our commercial growth
Satya Nadella, Chairman and CEO, shared the below communication with Microsoft employees this morning.
We are in the midst of a tectonic AI platform shift, one that requires us to both manage and grow our at-scale commercial business today, while building the new frontier and executing flawlessly across both.
History shows that general purpose technologies like AI drive step changes in productivity and GDP growth, and we have a unique opportunity to help our customers and the world realize this promise.
Our success depends on enabling commercial and public sector customers and partners to combine their human capital with new AI capabilities to change the frontier of how they operate. To accelerate this, we will increasingly need to bring together sales, marketing, operations, and engineering to drive growth and strengthen our position as the partner of choice for AI transformation.
With this context, I have asked Judson Althoff to take on an expanded role as CEO of our commercial business. Over the past nine years, Judson has led our global sales organization and was the architect behind designing and building Microsoft Customer and Partner Solutions (MCAPS) into what it is today: the “number one seed” in the industry and our company’s most important growth engine.
Takeshi Numoto and his marketing team will join this new organization, with Takeshi reporting directly to Judson as CMO, while also continuing to report directly to me on all-up business models, planning, consumer marketing, and corporate brand and communications.
Our operations organization will also move to report to Judson. By bringing operations into the commercial business, we can tighten the feedback loop between what customers need and how we deliver and support them. Carolina Dybeck Happe will continue to report to me, as she works on our overall company transformation and continues to closely partner with Judson.
Additionally, Judson will lead a new commercial leadership team that brings together leaders from engineering, sales, marketing, operations, and finance to drive our product strategy and governance, GTM readiness, and sales motions with shared accountability for the rigor and executional excellence our customers expect.
This will also allow our engineering leaders and me to be laser focused on our highest ambition technical work—across our datacenter buildout, systems architecture, AI science, and product innovation—to lead with intensity and pace in this generational platform shift. Each one of us needs to be at our very best in terms of rapidly learning new skills, adopting new ways to work, and staying close to the metal to drive innovation across the entire stack!!
This isn’t just evolution, it’s reinvention, for each of us professionally and for Microsoft.
Satya
The post Accelerating our commercial growth appeared first on The Official Microsoft Blog.
Satya Nadella, Chairman and CEO, shared the below communication with Microsoft employees this morning. We are in the midst of a tectonic AI platform shift, one that requires us to both manage and grow our at-scale commercial business today, while building the new frontier and executing flawlessly across both. History shows that general purpose technologies…
The post Accelerating our commercial growth appeared first on The Official Microsoft Blog.Read More
How do l increase the process gain by a factor of 10 and the time constant by a factor of 10
l simulated the response of my transfer function as shown on the attached image. Now l need to increase the process gain by a factor of 10 and the time constant by a factor of 10. How do l do it?l simulated the response of my transfer function as shown on the attached image. Now l need to increase the process gain by a factor of 10 and the time constant by a factor of 10. How do l do it? l simulated the response of my transfer function as shown on the attached image. Now l need to increase the process gain by a factor of 10 and the time constant by a factor of 10. How do l do it? proportional gain, time constant MATLAB Answers — New Questions
Adaptive PID Controller For DC Motor Speed Control
I am developing a program to control the speed of a DC motor using an adaptive PID controller. As I am just getting started with this type of control, I would greatly appreciate it if anyone could share code, algorithms for simulation, or practical implementation examples of such a controller for my referenceI am developing a program to control the speed of a DC motor using an adaptive PID controller. As I am just getting started with this type of control, I would greatly appreciate it if anyone could share code, algorithms for simulation, or practical implementation examples of such a controller for my reference I am developing a program to control the speed of a DC motor using an adaptive PID controller. As I am just getting started with this type of control, I would greatly appreciate it if anyone could share code, algorithms for simulation, or practical implementation examples of such a controller for my reference adaptive pid controller, matlab, simulink, dc motor MATLAB Answers — New Questions
MATLAB 2025a new fonts. How do I use them.
While poking around in the Preferences:Appearance:Fonts, I found some fonts I hadn’t seen in MATLAB before. For example the font "A.C.M.E. Secret Agent". What are these? Can I used them? How do I use them? Where are they?While poking around in the Preferences:Appearance:Fonts, I found some fonts I hadn’t seen in MATLAB before. For example the font "A.C.M.E. Secret Agent". What are these? Can I used them? How do I use them? Where are they? While poking around in the Preferences:Appearance:Fonts, I found some fonts I hadn’t seen in MATLAB before. For example the font "A.C.M.E. Secret Agent". What are these? Can I used them? How do I use them? Where are they? fonts MATLAB Answers — New Questions
How to save a mixed data (strings and integers) from workspace into a matlab data file?
Hello,
I want to save information processed from a large group of data into a matlab data file. For example:
a = 1253, b = 5869, c = 3569
char1 = "gyiuh"
column1 column2
value1 value1
value2 value2
value3 value3
.
.
.
N N
The savefile has both individual variables and tabulated data too. How can such a combination be saved in a single file so that they can be later retrieved for further processing? Thank you.Hello,
I want to save information processed from a large group of data into a matlab data file. For example:
a = 1253, b = 5869, c = 3569
char1 = "gyiuh"
column1 column2
value1 value1
value2 value2
value3 value3
.
.
.
N N
The savefile has both individual variables and tabulated data too. How can such a combination be saved in a single file so that they can be later retrieved for further processing? Thank you. Hello,
I want to save information processed from a large group of data into a matlab data file. For example:
a = 1253, b = 5869, c = 3569
char1 = "gyiuh"
column1 column2
value1 value1
value2 value2
value3 value3
.
.
.
N N
The savefile has both individual variables and tabulated data too. How can such a combination be saved in a single file so that they can be later retrieved for further processing? Thank you. data, processing, table, save MATLAB Answers — New Questions
Office 365 for IT Pros October 2025 Update
Monthly Update #124 for Office 365 for IT Pros Available for Download

The Office 365 for IT Pros team is delighted to announce the availability of the October 2025 update for Office 365 for IT Pros (2026 edition). This is monthly update #124. Current subscribers can download the updated EPUB and PDF files from their Gumroad.com account or by using the View content link in their receipt. See our FAQ for more information about how to download updates.
We’ve also updated the Automating Microsoft 365 with PowerShell eBook, which is now at version 16.4. The updated PowerShell EPUB and PDF files are available at the same location as the Office 365 for IT Pros book files. The paperback version of Automating Microsoft 365 with PowerShell has also been updated and is available on a print-on-demand basis from Amazon.
October Updates and the AI Effect
As usual, a bunch of changes are spread across the book chapters, details of which are in our change log. One thing that’s becoming increasingly notable is the growing percentage of Microsoft 365 message center notifications that relate to AI instead of updates to workloads like Exchange Online, SharePoint Online, and Teams.
It’s easy to understand why this is so. First, many of the Microsoft 365 workloads are very mature and already feature-rich, so less opportunity exists to add new functionality. Second, Microsoft’s development attention is obviously focused on adding as much AI-driven features to applications as possible to encourage customers to buy Microsoft 365 Copilot licenses.
The focus on AI gives us a challenge in deciding how much attention we should pay to Copilot features. We know that many Microsoft 365 tenants don’t use Copilot because the licenses are too expensive, they’ve chosen a different solution (like ChatGPT), or simply don’t see the value of AI in their environment at this point. While adding more Copilot content to the book might delight some tenants, it reduces the value of the book to other tenants.
Our current approach is to include Copilot content where it matters to tenant administration. An example is the configuration of the DLP policy to prevent Copilot Chat including content from sensitive documents in its responses. On the other hand, Copilot features that are user-centric in apps, like the facilitator agent in Teams, are usually not covered in the book. There are many of these features spread across Office and other apps. In addition, the features are in a period of rapid evolution, so documenting their use would occupy lots of time that could otherwise be used to cover topics of more general interest.
As AI becomes more embedded in administration (the initial skills available in Copilot for SharePoint Admin are a poor example of what will increasingly happen), we’ll probably change our guidelines, but that’s our current thinking.
Fixing the PDF Stamping Problem
As many of our subscribers know, Gumroad has struggled to fix a bug in the routine that stamps subscriber email addresses on our PDF files. The symptom is that the PDF is unavailable for download because it is “being prepared.” This doesn’t happen for all PDF downloads, but it happened enough to be a royal pain. Subscribers affected by the problem had to contact us, and the only workaround we had was to reissue the receipt. This action kicked off the PDF stamping routine and most of the time, it was enough to make the PDF available.
The good news is that we think Gumroad has fixed the problem by rewriting the PDF stamping routine. Every month in the recent past we have dealt with several subscribers who hit the problem. We’ll soon know if the Gumroad fix is effective. Fingers and toes are firmly crossed.
On to November 2025
As usual, we have started work on next month’s update (#125). Given that the Ignite conference is in the second half of November, there might be fewer changes to process. Then again, there’s always change in Microsoft 365, so we expect to be busy.