Category: News
Checking the Effectiveness of a Transport Rule to Block Spammy Email
No Point in Having Transport Rules if They’re Not Doing the Job
A few weeks ago, I wrote about using the Microsoft Graph to extract a list of spammy domains from messages in the Junk Email folder in user mailboxes. The list is then used as input to a transport rule so that any email arriving from spammy domains end up in the quarantine instead of user mailboxes. Apart from bothering users with system messages notifying them about quarantined email (Figure 1), the technique worked nicely. A scheduled Azure Automation runbook picks up new spammy domains as they appear and add them to the transport rule.

In fact, the transport rule worked so well that I decided to stop bothering users with quarantine notifications and updated the transport rule to delete messages from the spammy domains without saying anything to the sender. Now the only quarantine notifications that appear in user inboxes are for messages not received from the spammy domains.
Check and Verify
Then I had a nasty feeling that perhaps the transport rule was working too well and that some messages might have been dropped in error. My gut says that everything’s OK, but some verification would improve my confidence. One way of checking is to search user mailboxes to see if any messages from the banned domains have arrived since the rule started to operate, but that seems a little intrusive. Another method is needed.
To seek confirmation, I ran the Get-MailDetailTransportRuleReport cmdlet to fetch data about the outcomes of mail transport rules for the last 10 days (like message trace logs, 10 days is the maximum Exchange Online keeps this data available for immediate interrogation).
The transport rule report can filter on actions taken by rules. The set of supported actions can be found by running the Get-MailFilterListReport cmdlet:
Get-MailFilterListReport -SelectionTarget Actions SelectionTarget Display Value --------------- ------- ----- Actions AddBccRecipient AddBccRecipient Actions AddCcRecipient AddCcRecipient Actions AddManagerAsRecipient AddManagerAsRecipient Actions AddToRecipient AddToRecipient Actions Allow Allow Actions AllowRedirect AllowRedirect Actions ApplyClassification ApplyClassification Actions ApplyHtmlDisclaimer ApplyHtmlDisclaimer Actions BlockAccess BlockAccess etc.
Summarizing the Result of the Transport Rule Block
The transport rule deletes spammy messages quietly, so the right action to use is “DeleteMessage.” Here’s the command I used to find and summarize the events:
[array]$Data = Get-MailDetailTransportRuleReport -Direction inbound -Action DeleteMessage $Data | Group-Object 'TransportRule' -NoElement | Format-Table Name, Count Name Count ---- ----- Block email to administrators from outside the organization 65 Quarantine Traffic from Junk Email Domains 80
The information contained in a transport rule report event looks like this:
Date : 02/11/2025 10:42:06 Message ID : <89a2ec2634a1de9811917cb90a02fe3c@9pz.org> Message Trace ID : e07c2b05-ea8a-429d-e933-08de19fc77b1 Domain : office365itpros.com Subject : Re: We make packing bags in China Message Size : 31720 Direction : Inbound Sender Address : 1232@9pz.org Recipient Address : james.a.abrahams@office365itpros.com Event Type : TransportRuleActionHits Action : DeleteMessage Transport Rule : Quarantine Traffic from Junk Email Domains
We can extract and summarize the set of events for the block from spam domain transport rule to discover who would have received the spam had the block not existed:
$TransportRule = 'Quarantine Traffic from Junk Email Domains'
[array]$MData = $Data | Where-Object {$_.'TransportRule' -eq $TransportRule}
$MData | Group-Object -NoElement RecipientAddress | Sort-Object Count -Descending | Format-Table Name, Count
Name Count
---- -----
tony.redmond@office365itpros.com 27
james.a.abrahams@office365itpros.com 7
andy.ruth@office365itpros.com 5
lotte.vetler@office365itpros.com 5
sean.landy@office365itpros.com 5
brian.weakliam@office365itpros.com 4
jeff.atkinson@office365itpros.com 4
office365.book.comments@office365itpros.com 4
terry.hegarty@office365itpros.com 4
contact@office365itpros.com 3
o365itprosrenewals@office365itpros.com 2
marty.king@office365itpros.com 1
office365book@office365itpros.com 1
Most of these addresses are for dummy accounts or shared mailboxes used for testing. Spammers learn of the addresses by harvesting information from web articles, but they gain nothing by sending messages to the accounts. However, I don’t like cleaning out the spam before taking screenshots for articles, so I’m delighted to see that the transport rule is doing its job.
Finding how many messages came from specific spammy domains takes a little extra effort. Here’s some code to report the number of messages from each domain processed by the transport rule:
[array]$SpammyDomains = (Get-TransportRule -Identity $TransportRule).SenderDomainIs
ForEach ($Domain in $SpammyDomains) {
$CheckDomain = "*"+$Domain+"*"
[array]$SpamRecords = $MData | Where-Object {$_.SenderAddress -like $CheckDomain}
If ($SpamRecords.Count -gt 0) {
Write-Host ("Domain {0} sent {1} spammy messages" -f $Domain, $SpamRecords.Count)
}
}
Domain 9pz.org sent 7 spammy messages
Domain conarh02.com sent 6 spammy messages
Domain conarh03.com.mx sent 25 spammy messages
Domain conarh07.com sent 6 spammy messages
Domain spamareus.com sent 11 spammy messages
Domain fgwexvb.asia sent 4 spammy messages
Domain forkcontact.com sent 1 spammy messages
Domain moonpig.com sent 4 spammy messages
Domain annoyingcompany.co.uk sent 3 spammy messages
Domain tradetpt12.com sent 5 spammy messages
Domain tradetpxs10.com sent 4 spammy messages
Domain getportant.com sent 4 spammy messages
Some Manipulation Required
The lesson here is that a method exists to validate the effectiveness of transport rules. Extracting the desired information from the transport rule report might take some manipulation with PowerShell, but it’s certainly a way to check how well your rules work.
Learn about managing Exchange Online and the rest of the Microsoft 365 ecosystem by subscribing to the Office 365 for IT Pros eBook. Use our experience to understand what’s important and how best to protect your tenant.
effects of ifft2(x, ‘symmetric’) while x is not conjugate symmetric
Hi all,
I understand that ‘symmetric’ in ifft2 assumes data is conjugate symmetric and will output real values, but I want to know how exactly is this done. Specifically:
with ‘symmetric’, will only half of the data be used or still the whole matrix is used, but just output real values?
if x is not conjugate symmetric but I still pass in ‘symmetric’, what will happen?
Thanks in advance.Hi all,
I understand that ‘symmetric’ in ifft2 assumes data is conjugate symmetric and will output real values, but I want to know how exactly is this done. Specifically:
with ‘symmetric’, will only half of the data be used or still the whole matrix is used, but just output real values?
if x is not conjugate symmetric but I still pass in ‘symmetric’, what will happen?
Thanks in advance. Hi all,
I understand that ‘symmetric’ in ifft2 assumes data is conjugate symmetric and will output real values, but I want to know how exactly is this done. Specifically:
with ‘symmetric’, will only half of the data be used or still the whole matrix is used, but just output real values?
if x is not conjugate symmetric but I still pass in ‘symmetric’, what will happen?
Thanks in advance. fft MATLAB Answers — New Questions
Why isn’t this breaking the loop?
I have tried to use an ouptut argument to make a variable and use that variable in my main script, however when it is returning the value I want, it still isnt breaking the while loop?
Code for the function:
function continueChoice = cont()
continueChoice = listdlg("SelectionMode", "single", "ListString", ["Continue", "Exit"], "PromptString", "Would you like another statistic?")
end
Code in the main script:
data = readtable(‘alltimeteams.xlsx’,’VariableNamingRule’,’preserve’);
x = 0
while le(x,210)
x = x+1
choice=listdlg(‘SelectionMode’,’single’, ‘ListString’,data.Franchise,’PromptString’,’Please choose a franchise’); % all possible franchises
if isempty(choice)
fprintf("Please choose a franchise next time n")
break; % Exit the loop if no franchise is chosen
end
% the following is the problematic part
Wpercentchoice = listdlg("SelectionMode","single","PromptString","Would you like the win%?","ListString",["Yes","No"]);
if Wpercentchoice == 1
WinPercentcalc(data,choice); % calculates the overall win percentage (seperate function)
cont()
end
if isempty(continueChoice)
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
elseif continueChoice == 2
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
end
This is what shows in the command window after selecting "exit" in the listdlg
continueChoice =
2
ans =
2
continueChoice is 2, so shouldnt it work? It just carries on with the rest of my code instead.
Please lmk if any more info is needed.
P.S the reason I’ve made a function which is so short is because one of the criteria for the project im doing is that it has to have a function which has an ouptut argument and this is the only thing I could make one for , I understand it’d be a lot easier just doing it in the main script.I have tried to use an ouptut argument to make a variable and use that variable in my main script, however when it is returning the value I want, it still isnt breaking the while loop?
Code for the function:
function continueChoice = cont()
continueChoice = listdlg("SelectionMode", "single", "ListString", ["Continue", "Exit"], "PromptString", "Would you like another statistic?")
end
Code in the main script:
data = readtable(‘alltimeteams.xlsx’,’VariableNamingRule’,’preserve’);
x = 0
while le(x,210)
x = x+1
choice=listdlg(‘SelectionMode’,’single’, ‘ListString’,data.Franchise,’PromptString’,’Please choose a franchise’); % all possible franchises
if isempty(choice)
fprintf("Please choose a franchise next time n")
break; % Exit the loop if no franchise is chosen
end
% the following is the problematic part
Wpercentchoice = listdlg("SelectionMode","single","PromptString","Would you like the win%?","ListString",["Yes","No"]);
if Wpercentchoice == 1
WinPercentcalc(data,choice); % calculates the overall win percentage (seperate function)
cont()
end
if isempty(continueChoice)
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
elseif continueChoice == 2
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
end
This is what shows in the command window after selecting "exit" in the listdlg
continueChoice =
2
ans =
2
continueChoice is 2, so shouldnt it work? It just carries on with the rest of my code instead.
Please lmk if any more info is needed.
P.S the reason I’ve made a function which is so short is because one of the criteria for the project im doing is that it has to have a function which has an ouptut argument and this is the only thing I could make one for , I understand it’d be a lot easier just doing it in the main script. I have tried to use an ouptut argument to make a variable and use that variable in my main script, however when it is returning the value I want, it still isnt breaking the while loop?
Code for the function:
function continueChoice = cont()
continueChoice = listdlg("SelectionMode", "single", "ListString", ["Continue", "Exit"], "PromptString", "Would you like another statistic?")
end
Code in the main script:
data = readtable(‘alltimeteams.xlsx’,’VariableNamingRule’,’preserve’);
x = 0
while le(x,210)
x = x+1
choice=listdlg(‘SelectionMode’,’single’, ‘ListString’,data.Franchise,’PromptString’,’Please choose a franchise’); % all possible franchises
if isempty(choice)
fprintf("Please choose a franchise next time n")
break; % Exit the loop if no franchise is chosen
end
% the following is the problematic part
Wpercentchoice = listdlg("SelectionMode","single","PromptString","Would you like the win%?","ListString",["Yes","No"]);
if Wpercentchoice == 1
WinPercentcalc(data,choice); % calculates the overall win percentage (seperate function)
cont()
end
if isempty(continueChoice)
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
elseif continueChoice == 2
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
end
This is what shows in the command window after selecting "exit" in the listdlg
continueChoice =
2
ans =
2
continueChoice is 2, so shouldnt it work? It just carries on with the rest of my code instead.
Please lmk if any more info is needed.
P.S the reason I’ve made a function which is so short is because one of the criteria for the project im doing is that it has to have a function which has an ouptut argument and this is the only thing I could make one for , I understand it’d be a lot easier just doing it in the main script. function, output, if statement MATLAB Answers — New Questions
Finite elements model using STABIL
We are working on a finite elements model using the plug-in STABIL. We get no errors but our displacements are all giving NaN as solution. Can someone explain the meaning of these NaNs? Our K and P matrix look logical so we are out of options…
%initializing
clc
close all
clear all
% units kN,m
unzip(‘stabil-3.1.zip’);
% CALCULATING THE NODES
%STEP N1: the deck
% Nodes=[NodID X Y Z]
Nodes= [1 21 0 4;
2 21+5.25*1 0 4;
3 21+5.25*2 0 4;
4 21+5.25*3 0 4;
5 21+5.25*4 0 4;
6 21+5.25*5 0 4;
7 21+5.25*6 0 4;
8 21+5.25*7 0 4;
9 21+5.25*8 0 4];
Nodes = reprow(Nodes, 1:9, 1, [9 0 4.2 0]);
Nodes = reprow(Nodes, 10:18, 1, [9 0 4.5 0]);
Nodes = reprow(Nodes, 19:27, 1, [9 0 4.2 0]);
Nodes = reprow(Nodes, 28:36, 1, [9 0 3.7 0]);
%STEP N2: the 3 top points of triangle, then copy to second triangle
Nodes= [Nodes;
46 31.5 0 14.5;
47 42 0 25;
48 52.5 0 14.5];
Nodes = reprow(Nodes, 46:48, 1, [3 0 12.9 0]);
%STEP N3: reprow the full triangle + deck two times
%no overlapping nodes
%second triangle + deck
Nodes = reprow(Nodes, 1:8,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 10:17,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 19:26,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 28:35,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 37:44,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 46:51,1,[51 42 0 0]);
%third triangle + deck
Nodes = reprow(Nodes, 1:8,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 10:17,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 19:26,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 28:35,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 37:44,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 46:51,1,[102 84 0 0]);
%STEP N4: add the other notes of the deck parts not directly supported by
%the triangles to the left and right
%The left
Nodes = [Nodes;
154 0 0 4;
155 5.25 0 4;
156 10.5 0 4;
157 15.75 0 4;
158 0 4.2 4;
159 5.25 4.2 4;
160 10.5 4.2 4;
161 15.75 4.2 4;
162 0 8.7 4;
163 5.25 8.7 4;
164 10.5 8.7 4;
165 15.75 8.7 4;
166 0 12.9 4;
167 5.25 12.9 4;
168 10.5 12.9 4;
169 15.75 12.9 4;
170 0 16.6 4;
171 5.25 16.6 4;
172 10.5 16.6 4;
173 15.75 16.6 4];
%The right
Nodes = [Nodes;
174 152.25 0 4;
175 157.5 0 4;
176 162.75 0 4;
177 168 0 4;
178 152.25 4.2 4;
179 157.5 4.2 4;
180 162.75 4.2 4;
181 168 4.2 4;
182 152.25 8.7 4;
183 157.5 8.7 4;
184 162.75 8.7 4;
185 168 8.7 4;
186 152.25 12.9 4;
187 157.5 12.9 4;
188 162.75 12.9 4;
189 168 12.9 4;
190 152.25 16.6 4;
191 157.5 16.6 4;
192 162.75 16.6 4;
193 168 16.6 4];
%STEP N5: reference nodes
%Longitudinal beams and diagonal beams triangle 1 to 47 and copies
Nodes= [Nodes;
500 0 0 100;
501 0 4.2 100;
502 0 8.7 100;
503 0 12.9 100;
504 0 16.6 100];
%Beam element from 47 to 9 and all the copies
%also the ones going from 46 to 5 and the copies
Nodes= [Nodes;
505 168 0 100;
506 168 12.9 100];
%Transversal beams
Nodes= [Nodes;
507 31.5 0 100;
508 42 0 100;
509 52.5 0 100;
510 31.5+42 0 100;
511 42+42 0 100;
512 52.5+42 0 100;
513 31.5+42*2 0 100;
514 42+42*2 0 100;
515 52.5+42*2 0 100];
%STEP E1: initializing
% Element types -> {EltTypID EltName}
Types= {1 ‘beam’;
2 ‘truss’};
% Sections=[SecID A ky kz Ixx Iyy Izz] !!!all in m
Sections = [1 0.265*0.990*2 Inf Inf 2*(1/12*0.265*0.990^3) 2*(1/12*0.265*0.990^3) 2*(1/12*0.265*0.990^3); % plywood king post beam
2 0.265*0.540*2 Inf Inf 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3); % plywood diagonal beam
3 0.265*0.540*2 Inf Inf 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3); % horizontal beam
4 ((0.314/2)^2*pi-(0.314/2-0.019)^2*pi) NaN NaN NaN NaN NaN; % steel vertical
5 ((0.314/2)^2*pi-(0.314/2-0.019)^2*pi) NaN NaN NaN NaN NaN; % diagonal steel truss (only A)
6 0.265*0.1350*2 Inf Inf 2*(1/12*0.265*0.1350^3) 2*(1/12*0.265*0.1350^3) 2*(1/12*0.265*0.1350^3); % outer deck beam
7 0.240*0.1350*2 Inf Inf 2*(1/12*0.240*0.1350^3) 2*(1/12*0.240*0.1350^3) 2*(1/12*0.240*0.1350^3); % inner deck beam
8 0.200*0.650 Inf Inf 1/12*0.200*0.650^3 1/12*0.200*0.650^3 1/12*0.200*0.650^3; % outer footbridge
9 0.100*0.100 NaN NaN NaN NaN NaN]; % deck truss steel
% Materials=[MatID E nu rho];
Materials= [1 7.75e6 0.2 2000; % plywood
2 210e6 0.3 7500]; % steel KN/m2
% Elements=[EltID TypID SecID MatID n1 n2 n3]
%STEP E2: deck longitudonal plywood beams
%First triangle
Elements= [1 1 6 1 1 2 500;
2 1 7 1 10 11 501;
3 1 7 1 19 20 502;
4 1 6 1 28 29 503;
5 1 8 1 37 38 504];
Elements=reprow(Elements,1:5,7,[5 0 0 0 1 1 0]);
%Second triangle
Elements=[Elements;
41 1 6 1 9 52 500;
42 1 7 1 18 61 501;
43 1 7 1 27 70 502;
44 1 6 1 36 79 503;
45 1 8 1 45 88 504];
Elements= [Elements;
46 1 6 1 52 53 500;
47 1 7 1 61 62 501;
48 1 7 1 70 71 502;
49 1 6 1 79 80 503;
50 1 8 1 88 89 504];
Elements=reprow(Elements,46:50,6,[5 0 0 0 1 1 0]);
%Third triangle
Elements=[Elements;
81 1 6 1 59 103 500;
82 1 7 1 68 112 501;
83 1 7 1 77 121 502;
84 1 6 1 86 130 503;
85 1 8 1 95 139 504];
Elements= [Elements;
86 1 6 1 103 104 500;
87 1 7 1 112 113 501;
88 1 7 1 121 122 502;
89 1 6 1 130 131 503;
90 1 8 1 139 140 504];
Elements=reprow(Elements,86:90,6,[5 0 0 0 1 1 0]);
%Deck on the right of the triangles
Elements= [Elements;
121 1 6 1 110 174 500;
122 1 7 1 119 178 501;
123 1 7 1 128 182 502;
124 1 6 1 137 186 503;
125 1 8 1 146 190 504];
Elements= [Elements;
126 1 6 1 174 175 500;
127 1 7 1 178 179 501;
128 1 7 1 182 183 502;
129 1 6 1 186 187 503;
130 1 8 1 190 191 504];
Elements=reprow(Elements,126:130,2,[5 0 0 0 1 1 0]);
%Deck on the left of the triangles
Elements= [Elements;
141 1 6 1 154 155 500;
142 1 7 1 158 159 501;
143 1 7 1 162 163 502;
144 1 6 1 166 167 503;
145 1 8 1 170 171 504];
Elements=reprow(Elements,141:145,2,[5 0 0 0 1 1 0]);
Elements= [Elements;
156 1 6 1 157 1 500;
157 1 7 1 161 10 501;
158 1 7 1 165 19 502;
159 1 6 1 169 28 503;
160 1 8 1 173 37 504];
%STEP E2: deck transversal steel trusses
%First triangle
Elements= [Elements;
161 2 9 1 1 10 NaN;
162 2 9 1 10 19 NaN;
163 2 9 1 19 28 NaN;
164 2 9 1 28 37 NaN];
Elements=reprow(Elements,161:164,8,[4 0 0 0 1 1 0]);
%Second triangle
Elements= [Elements;
197 2 9 1 52 61 NaN;
198 2 9 1 61 70 NaN;
199 2 9 1 70 79 NaN;
200 2 9 1 79 88 NaN];
Elements=reprow(Elements,197:200,7,[4 0 0 0 1 1 0]);
%Third triangle
Elements= [Elements;
229 2 9 1 103 112 NaN;
230 2 9 1 112 121 NaN;
231 2 9 1 121 130 NaN;
232 2 9 1 130 139 NaN];
Elements=reprow(Elements,229:232,7,[4 0 0 0 1 1 0]);
%Right of the triangles
Elements= [Elements;
261 2 9 1 174 178 NaN;
262 2 9 1 178 182 NaN;
263 2 9 1 182 186 NaN;
264 2 9 1 186 190 NaN];
Elements=reprow(Elements,261:264,3,[4 0 0 0 1 1 0]);
%Left of the triangles
Elements= [Elements;
277 2 9 1 154 158 NaN;
278 2 9 1 158 162 NaN;
279 2 9 1 162 166 NaN;
280 2 9 1 166 170 NaN];
Elements=reprow(Elements,277:280,3,[4 0 0 0 1 1 0]);
%STEP E3: Beams elements triangles
%Beam element from 1 to 47 and all the copies (king post truss up)
Elements= [Elements;
293 1 1 1 1 47 500;
294 1 1 1 9 98 500;
295 1 1 1 59 149 500;
296 1 1 1 28 50 503;
297 1 1 1 36 101 503;
298 1 1 1 86 152 503];
%Beam element from 47 to 9 and all the copies (king post truss down)
Elements= [Elements;
299 1 1 1 47 9 505;
300 1 1 1 98 59 505;
301 1 1 1 149 110 505;
302 1 1 1 50 36 506;
303 1 1 1 101 86 506;
304 1 1 1 152 137 506];
%Beam element from 5 to 48 and all the copies (side diagonal)
Elements= [Elements;
305 1 2 1 5 48 500;
306 1 2 1 55 99 500;
307 1 2 1 106 150 500;
308 1 2 1 32 51 503;
309 1 2 1 82 102 503;
310 1 2 1 133 153 503];
%Beam element from 46 to 5 and all the copies (side diagonal)
Elements= [Elements;
311 1 2 1 46 5 505;
312 1 2 1 97 55 505;
313 1 2 1 148 106 505;
314 1 2 1 49 32 506;
315 1 2 1 100 82 506;
316 1 2 1 151 133 506];
%Transversal beams between the triangles
Elements= [Elements;
317 1 3 1 46 49 507;
318 1 3 1 47 50 508;
319 1 3 1 48 51 509;
320 1 3 1 97 100 510;
321 1 3 1 98 101 511;
322 1 3 1 99 102 512;
323 1 3 1 148 151 513;
324 1 3 1 149 152 514;
325 1 3 1 150 153 515];
%STEP E4: Truss elements triangles
%Vertical steel trusses
%First triangle
Elements= [Elements;
326 2 4 2 46 3 NaN;
327 2 4 2 47 5 NaN;
328 2 4 2 48 7 NaN;
329 2 4 2 49 30 NaN;
330 2 4 2 50 32 NaN;
331 2 4 2 51 34 NaN];
%Second triangle
Elements= [Elements;
332 2 4 2 97 53 NaN;
333 2 4 2 98 55 NaN;
334 2 4 2 99 57 NaN;
335 2 4 2 100 80 NaN;
336 2 4 2 101 82 NaN;
337 2 4 2 102 84 NaN];
%Third triangle
Elements= [Elements;
338 2 4 2 148 104 NaN;
339 2 4 2 149 106 NaN;
340 2 4 2 150 108 NaN;
341 2 4 2 151 131 NaN;
342 2 4 2 152 133 NaN;
343 2 4 2 153 135 NaN];
%Diagonal trusses
%First triangle
Elements= [Elements;
344 2 5 2 46 50 NaN;
345 2 5 2 47 49 NaN;
346 2 5 2 47 51 NaN;
347 2 5 2 48 50 NaN];
%Second triangle
Elements= [Elements;
348 2 5 2 97 101 NaN;
349 2 5 2 101 99 NaN;
350 2 5 2 98 100 NaN;
351 2 5 2 98 102 NaN];
%Third triangle
Elements= [Elements;
352 2 5 2 148 152 NaN;
353 2 5 2 150 152 NaN;
354 2 5 2 149 151 NaN;
355 2 5 2 149 153 NaN];
%STEP E5: plot
figure
plotelem(Nodes,Elements(find(Elements(:,3)==1),:),Types,’bl’);
hold(‘on’);
plotelem(Nodes,Elements(find(Elements(:,3)==2),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==3),:),Types,’m’);
plotelem(Nodes,Elements(find(Elements(:,3)==4),:),Types,’r’);
plotelem(Nodes,Elements(find(Elements(:,3)==5),:),Types,’r’);
plotelem(Nodes,Elements(find(Elements(:,3)==6),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==7),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==8),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==9),:),Types,’r’);
title(‘Elements’)
figure
plotnodes(Nodes);
title(‘Nodes’)
%STEP D1: generate all possible DOF
DOFall = getdof(Elements,Types);
%STEP D2: remove the DOF limited by the boundary conditions
selnodes = [1;9;28;36;59;86;110;137;154;158;162;166;170;177;181;185;189;193];
dofpattern = [0.01 0.02 0.03]; % the three dof’s
seldof = selnodes + dofpattern; % for the selected nodes, the pattern of dof
seldof = seldof(:);
DOF = removedof(DOFall,seldof);
%STEP K1: assemble the K matrix
K = asmkm(Nodes,Elements,Types,Sections,Materials,DOF);
%STEP K2: check the K matrix
%check symmetry
disp(K-K’)
det(K)
issymmetric(K)
%positive definite
find(eig(K)<0)
%to check wheter invertible
%Now we assign the correct loads to the structure
%STEP L1: compute the self weight of the structure
% Own weight
DLoadsOwn=accel([0 0 9.81e-3],Elements,Types,Sections,Materials);
%STEP L2: compute the distributed load working on the deck
%Combine with own weight and turn into elemloads
%DLoads=[EltID n1globalX n1globalY n1globalZ …]
DLoadsTraffic = zeros([160 7]);
DLoadsTraffic =[DLoadsTraffic;
161 0 0 -2.5 0 0 -2.5;
162 0 0 -2.5 0 0 -2.5;
163 0 0 -2.5 0 0 -2.5;
164 0 0 -9 0 0 -9];
DLoadsTraffic=reprow(DLoadsTraffic,161:164,32,[4 0 0 0 0 0 0]);
DLoadsTraffic = [DLoadsTraffic;
zeros([355-292 7])];
DLoadsOwn(161:292,1)=0;
DLoads = DLoadsOwn + DLoadsTraffic
P=elemloads(DLoads,Nodes,Elements,Types,DOF);
%P = P1+P2
%STEP L3: compute the point loads working on the deck
% Nodal loads: 5 kN horizontally on node 4.
%seldof=[4.01];
%PLoad= [5];
% Assembly of the load vectors:
%P=nodalvalues(DOF,seldof,PLoad);
%PLoad=[0]
%seldof=[]
%Pp=nodalvalues(DOF,seldof,PLoad);
%STEP L4: Compute P
%STEP U1: Compute the displacements
U=KP;
% Plot displacements
figure
plotdisp(Nodes,Elements,Types,DOF,U,’DispScal’,5)
title(‘Displacements’)
exportgraphics(gcf,’FE_DYB_Displ.jpg’,’Resolution’,300)
printdisp(Nodes,DOF,U);
% Compute element forces
Forces=elemforces(Nodes,Elements,Types,Sections,Materials,DOF,U,DLoads);
printforc(Elements,Forces);
% Plot element forces
figure
plotforc(‘norm’,Nodes,Elements,Types,Forces,DLoads)
title(‘Normal forces’)
exportgraphics(gcf,’FE_DYB_Normal.jpg’,’Resolution’,300)
figure
plotforc(‘sheary’,Nodes,Elements,Types,Forces,DLoads)
title(‘Shear forces’)
exportgraphics(gcf,’FE_DYB_Shear.jpg’,’Resolution’,300)
figure
plotforc(‘momz’,Nodes,Elements,Types,Forces,DLoads)
title(‘Bending moments’)
exportgraphics(gcf,’FE_DYB_Moment.jpg’,’Resolution’,300)We are working on a finite elements model using the plug-in STABIL. We get no errors but our displacements are all giving NaN as solution. Can someone explain the meaning of these NaNs? Our K and P matrix look logical so we are out of options…
%initializing
clc
close all
clear all
% units kN,m
unzip(‘stabil-3.1.zip’);
% CALCULATING THE NODES
%STEP N1: the deck
% Nodes=[NodID X Y Z]
Nodes= [1 21 0 4;
2 21+5.25*1 0 4;
3 21+5.25*2 0 4;
4 21+5.25*3 0 4;
5 21+5.25*4 0 4;
6 21+5.25*5 0 4;
7 21+5.25*6 0 4;
8 21+5.25*7 0 4;
9 21+5.25*8 0 4];
Nodes = reprow(Nodes, 1:9, 1, [9 0 4.2 0]);
Nodes = reprow(Nodes, 10:18, 1, [9 0 4.5 0]);
Nodes = reprow(Nodes, 19:27, 1, [9 0 4.2 0]);
Nodes = reprow(Nodes, 28:36, 1, [9 0 3.7 0]);
%STEP N2: the 3 top points of triangle, then copy to second triangle
Nodes= [Nodes;
46 31.5 0 14.5;
47 42 0 25;
48 52.5 0 14.5];
Nodes = reprow(Nodes, 46:48, 1, [3 0 12.9 0]);
%STEP N3: reprow the full triangle + deck two times
%no overlapping nodes
%second triangle + deck
Nodes = reprow(Nodes, 1:8,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 10:17,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 19:26,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 28:35,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 37:44,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 46:51,1,[51 42 0 0]);
%third triangle + deck
Nodes = reprow(Nodes, 1:8,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 10:17,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 19:26,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 28:35,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 37:44,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 46:51,1,[102 84 0 0]);
%STEP N4: add the other notes of the deck parts not directly supported by
%the triangles to the left and right
%The left
Nodes = [Nodes;
154 0 0 4;
155 5.25 0 4;
156 10.5 0 4;
157 15.75 0 4;
158 0 4.2 4;
159 5.25 4.2 4;
160 10.5 4.2 4;
161 15.75 4.2 4;
162 0 8.7 4;
163 5.25 8.7 4;
164 10.5 8.7 4;
165 15.75 8.7 4;
166 0 12.9 4;
167 5.25 12.9 4;
168 10.5 12.9 4;
169 15.75 12.9 4;
170 0 16.6 4;
171 5.25 16.6 4;
172 10.5 16.6 4;
173 15.75 16.6 4];
%The right
Nodes = [Nodes;
174 152.25 0 4;
175 157.5 0 4;
176 162.75 0 4;
177 168 0 4;
178 152.25 4.2 4;
179 157.5 4.2 4;
180 162.75 4.2 4;
181 168 4.2 4;
182 152.25 8.7 4;
183 157.5 8.7 4;
184 162.75 8.7 4;
185 168 8.7 4;
186 152.25 12.9 4;
187 157.5 12.9 4;
188 162.75 12.9 4;
189 168 12.9 4;
190 152.25 16.6 4;
191 157.5 16.6 4;
192 162.75 16.6 4;
193 168 16.6 4];
%STEP N5: reference nodes
%Longitudinal beams and diagonal beams triangle 1 to 47 and copies
Nodes= [Nodes;
500 0 0 100;
501 0 4.2 100;
502 0 8.7 100;
503 0 12.9 100;
504 0 16.6 100];
%Beam element from 47 to 9 and all the copies
%also the ones going from 46 to 5 and the copies
Nodes= [Nodes;
505 168 0 100;
506 168 12.9 100];
%Transversal beams
Nodes= [Nodes;
507 31.5 0 100;
508 42 0 100;
509 52.5 0 100;
510 31.5+42 0 100;
511 42+42 0 100;
512 52.5+42 0 100;
513 31.5+42*2 0 100;
514 42+42*2 0 100;
515 52.5+42*2 0 100];
%STEP E1: initializing
% Element types -> {EltTypID EltName}
Types= {1 ‘beam’;
2 ‘truss’};
% Sections=[SecID A ky kz Ixx Iyy Izz] !!!all in m
Sections = [1 0.265*0.990*2 Inf Inf 2*(1/12*0.265*0.990^3) 2*(1/12*0.265*0.990^3) 2*(1/12*0.265*0.990^3); % plywood king post beam
2 0.265*0.540*2 Inf Inf 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3); % plywood diagonal beam
3 0.265*0.540*2 Inf Inf 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3); % horizontal beam
4 ((0.314/2)^2*pi-(0.314/2-0.019)^2*pi) NaN NaN NaN NaN NaN; % steel vertical
5 ((0.314/2)^2*pi-(0.314/2-0.019)^2*pi) NaN NaN NaN NaN NaN; % diagonal steel truss (only A)
6 0.265*0.1350*2 Inf Inf 2*(1/12*0.265*0.1350^3) 2*(1/12*0.265*0.1350^3) 2*(1/12*0.265*0.1350^3); % outer deck beam
7 0.240*0.1350*2 Inf Inf 2*(1/12*0.240*0.1350^3) 2*(1/12*0.240*0.1350^3) 2*(1/12*0.240*0.1350^3); % inner deck beam
8 0.200*0.650 Inf Inf 1/12*0.200*0.650^3 1/12*0.200*0.650^3 1/12*0.200*0.650^3; % outer footbridge
9 0.100*0.100 NaN NaN NaN NaN NaN]; % deck truss steel
% Materials=[MatID E nu rho];
Materials= [1 7.75e6 0.2 2000; % plywood
2 210e6 0.3 7500]; % steel KN/m2
% Elements=[EltID TypID SecID MatID n1 n2 n3]
%STEP E2: deck longitudonal plywood beams
%First triangle
Elements= [1 1 6 1 1 2 500;
2 1 7 1 10 11 501;
3 1 7 1 19 20 502;
4 1 6 1 28 29 503;
5 1 8 1 37 38 504];
Elements=reprow(Elements,1:5,7,[5 0 0 0 1 1 0]);
%Second triangle
Elements=[Elements;
41 1 6 1 9 52 500;
42 1 7 1 18 61 501;
43 1 7 1 27 70 502;
44 1 6 1 36 79 503;
45 1 8 1 45 88 504];
Elements= [Elements;
46 1 6 1 52 53 500;
47 1 7 1 61 62 501;
48 1 7 1 70 71 502;
49 1 6 1 79 80 503;
50 1 8 1 88 89 504];
Elements=reprow(Elements,46:50,6,[5 0 0 0 1 1 0]);
%Third triangle
Elements=[Elements;
81 1 6 1 59 103 500;
82 1 7 1 68 112 501;
83 1 7 1 77 121 502;
84 1 6 1 86 130 503;
85 1 8 1 95 139 504];
Elements= [Elements;
86 1 6 1 103 104 500;
87 1 7 1 112 113 501;
88 1 7 1 121 122 502;
89 1 6 1 130 131 503;
90 1 8 1 139 140 504];
Elements=reprow(Elements,86:90,6,[5 0 0 0 1 1 0]);
%Deck on the right of the triangles
Elements= [Elements;
121 1 6 1 110 174 500;
122 1 7 1 119 178 501;
123 1 7 1 128 182 502;
124 1 6 1 137 186 503;
125 1 8 1 146 190 504];
Elements= [Elements;
126 1 6 1 174 175 500;
127 1 7 1 178 179 501;
128 1 7 1 182 183 502;
129 1 6 1 186 187 503;
130 1 8 1 190 191 504];
Elements=reprow(Elements,126:130,2,[5 0 0 0 1 1 0]);
%Deck on the left of the triangles
Elements= [Elements;
141 1 6 1 154 155 500;
142 1 7 1 158 159 501;
143 1 7 1 162 163 502;
144 1 6 1 166 167 503;
145 1 8 1 170 171 504];
Elements=reprow(Elements,141:145,2,[5 0 0 0 1 1 0]);
Elements= [Elements;
156 1 6 1 157 1 500;
157 1 7 1 161 10 501;
158 1 7 1 165 19 502;
159 1 6 1 169 28 503;
160 1 8 1 173 37 504];
%STEP E2: deck transversal steel trusses
%First triangle
Elements= [Elements;
161 2 9 1 1 10 NaN;
162 2 9 1 10 19 NaN;
163 2 9 1 19 28 NaN;
164 2 9 1 28 37 NaN];
Elements=reprow(Elements,161:164,8,[4 0 0 0 1 1 0]);
%Second triangle
Elements= [Elements;
197 2 9 1 52 61 NaN;
198 2 9 1 61 70 NaN;
199 2 9 1 70 79 NaN;
200 2 9 1 79 88 NaN];
Elements=reprow(Elements,197:200,7,[4 0 0 0 1 1 0]);
%Third triangle
Elements= [Elements;
229 2 9 1 103 112 NaN;
230 2 9 1 112 121 NaN;
231 2 9 1 121 130 NaN;
232 2 9 1 130 139 NaN];
Elements=reprow(Elements,229:232,7,[4 0 0 0 1 1 0]);
%Right of the triangles
Elements= [Elements;
261 2 9 1 174 178 NaN;
262 2 9 1 178 182 NaN;
263 2 9 1 182 186 NaN;
264 2 9 1 186 190 NaN];
Elements=reprow(Elements,261:264,3,[4 0 0 0 1 1 0]);
%Left of the triangles
Elements= [Elements;
277 2 9 1 154 158 NaN;
278 2 9 1 158 162 NaN;
279 2 9 1 162 166 NaN;
280 2 9 1 166 170 NaN];
Elements=reprow(Elements,277:280,3,[4 0 0 0 1 1 0]);
%STEP E3: Beams elements triangles
%Beam element from 1 to 47 and all the copies (king post truss up)
Elements= [Elements;
293 1 1 1 1 47 500;
294 1 1 1 9 98 500;
295 1 1 1 59 149 500;
296 1 1 1 28 50 503;
297 1 1 1 36 101 503;
298 1 1 1 86 152 503];
%Beam element from 47 to 9 and all the copies (king post truss down)
Elements= [Elements;
299 1 1 1 47 9 505;
300 1 1 1 98 59 505;
301 1 1 1 149 110 505;
302 1 1 1 50 36 506;
303 1 1 1 101 86 506;
304 1 1 1 152 137 506];
%Beam element from 5 to 48 and all the copies (side diagonal)
Elements= [Elements;
305 1 2 1 5 48 500;
306 1 2 1 55 99 500;
307 1 2 1 106 150 500;
308 1 2 1 32 51 503;
309 1 2 1 82 102 503;
310 1 2 1 133 153 503];
%Beam element from 46 to 5 and all the copies (side diagonal)
Elements= [Elements;
311 1 2 1 46 5 505;
312 1 2 1 97 55 505;
313 1 2 1 148 106 505;
314 1 2 1 49 32 506;
315 1 2 1 100 82 506;
316 1 2 1 151 133 506];
%Transversal beams between the triangles
Elements= [Elements;
317 1 3 1 46 49 507;
318 1 3 1 47 50 508;
319 1 3 1 48 51 509;
320 1 3 1 97 100 510;
321 1 3 1 98 101 511;
322 1 3 1 99 102 512;
323 1 3 1 148 151 513;
324 1 3 1 149 152 514;
325 1 3 1 150 153 515];
%STEP E4: Truss elements triangles
%Vertical steel trusses
%First triangle
Elements= [Elements;
326 2 4 2 46 3 NaN;
327 2 4 2 47 5 NaN;
328 2 4 2 48 7 NaN;
329 2 4 2 49 30 NaN;
330 2 4 2 50 32 NaN;
331 2 4 2 51 34 NaN];
%Second triangle
Elements= [Elements;
332 2 4 2 97 53 NaN;
333 2 4 2 98 55 NaN;
334 2 4 2 99 57 NaN;
335 2 4 2 100 80 NaN;
336 2 4 2 101 82 NaN;
337 2 4 2 102 84 NaN];
%Third triangle
Elements= [Elements;
338 2 4 2 148 104 NaN;
339 2 4 2 149 106 NaN;
340 2 4 2 150 108 NaN;
341 2 4 2 151 131 NaN;
342 2 4 2 152 133 NaN;
343 2 4 2 153 135 NaN];
%Diagonal trusses
%First triangle
Elements= [Elements;
344 2 5 2 46 50 NaN;
345 2 5 2 47 49 NaN;
346 2 5 2 47 51 NaN;
347 2 5 2 48 50 NaN];
%Second triangle
Elements= [Elements;
348 2 5 2 97 101 NaN;
349 2 5 2 101 99 NaN;
350 2 5 2 98 100 NaN;
351 2 5 2 98 102 NaN];
%Third triangle
Elements= [Elements;
352 2 5 2 148 152 NaN;
353 2 5 2 150 152 NaN;
354 2 5 2 149 151 NaN;
355 2 5 2 149 153 NaN];
%STEP E5: plot
figure
plotelem(Nodes,Elements(find(Elements(:,3)==1),:),Types,’bl’);
hold(‘on’);
plotelem(Nodes,Elements(find(Elements(:,3)==2),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==3),:),Types,’m’);
plotelem(Nodes,Elements(find(Elements(:,3)==4),:),Types,’r’);
plotelem(Nodes,Elements(find(Elements(:,3)==5),:),Types,’r’);
plotelem(Nodes,Elements(find(Elements(:,3)==6),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==7),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==8),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==9),:),Types,’r’);
title(‘Elements’)
figure
plotnodes(Nodes);
title(‘Nodes’)
%STEP D1: generate all possible DOF
DOFall = getdof(Elements,Types);
%STEP D2: remove the DOF limited by the boundary conditions
selnodes = [1;9;28;36;59;86;110;137;154;158;162;166;170;177;181;185;189;193];
dofpattern = [0.01 0.02 0.03]; % the three dof’s
seldof = selnodes + dofpattern; % for the selected nodes, the pattern of dof
seldof = seldof(:);
DOF = removedof(DOFall,seldof);
%STEP K1: assemble the K matrix
K = asmkm(Nodes,Elements,Types,Sections,Materials,DOF);
%STEP K2: check the K matrix
%check symmetry
disp(K-K’)
det(K)
issymmetric(K)
%positive definite
find(eig(K)<0)
%to check wheter invertible
%Now we assign the correct loads to the structure
%STEP L1: compute the self weight of the structure
% Own weight
DLoadsOwn=accel([0 0 9.81e-3],Elements,Types,Sections,Materials);
%STEP L2: compute the distributed load working on the deck
%Combine with own weight and turn into elemloads
%DLoads=[EltID n1globalX n1globalY n1globalZ …]
DLoadsTraffic = zeros([160 7]);
DLoadsTraffic =[DLoadsTraffic;
161 0 0 -2.5 0 0 -2.5;
162 0 0 -2.5 0 0 -2.5;
163 0 0 -2.5 0 0 -2.5;
164 0 0 -9 0 0 -9];
DLoadsTraffic=reprow(DLoadsTraffic,161:164,32,[4 0 0 0 0 0 0]);
DLoadsTraffic = [DLoadsTraffic;
zeros([355-292 7])];
DLoadsOwn(161:292,1)=0;
DLoads = DLoadsOwn + DLoadsTraffic
P=elemloads(DLoads,Nodes,Elements,Types,DOF);
%P = P1+P2
%STEP L3: compute the point loads working on the deck
% Nodal loads: 5 kN horizontally on node 4.
%seldof=[4.01];
%PLoad= [5];
% Assembly of the load vectors:
%P=nodalvalues(DOF,seldof,PLoad);
%PLoad=[0]
%seldof=[]
%Pp=nodalvalues(DOF,seldof,PLoad);
%STEP L4: Compute P
%STEP U1: Compute the displacements
U=KP;
% Plot displacements
figure
plotdisp(Nodes,Elements,Types,DOF,U,’DispScal’,5)
title(‘Displacements’)
exportgraphics(gcf,’FE_DYB_Displ.jpg’,’Resolution’,300)
printdisp(Nodes,DOF,U);
% Compute element forces
Forces=elemforces(Nodes,Elements,Types,Sections,Materials,DOF,U,DLoads);
printforc(Elements,Forces);
% Plot element forces
figure
plotforc(‘norm’,Nodes,Elements,Types,Forces,DLoads)
title(‘Normal forces’)
exportgraphics(gcf,’FE_DYB_Normal.jpg’,’Resolution’,300)
figure
plotforc(‘sheary’,Nodes,Elements,Types,Forces,DLoads)
title(‘Shear forces’)
exportgraphics(gcf,’FE_DYB_Shear.jpg’,’Resolution’,300)
figure
plotforc(‘momz’,Nodes,Elements,Types,Forces,DLoads)
title(‘Bending moments’)
exportgraphics(gcf,’FE_DYB_Moment.jpg’,’Resolution’,300) We are working on a finite elements model using the plug-in STABIL. We get no errors but our displacements are all giving NaN as solution. Can someone explain the meaning of these NaNs? Our K and P matrix look logical so we are out of options…
%initializing
clc
close all
clear all
% units kN,m
unzip(‘stabil-3.1.zip’);
% CALCULATING THE NODES
%STEP N1: the deck
% Nodes=[NodID X Y Z]
Nodes= [1 21 0 4;
2 21+5.25*1 0 4;
3 21+5.25*2 0 4;
4 21+5.25*3 0 4;
5 21+5.25*4 0 4;
6 21+5.25*5 0 4;
7 21+5.25*6 0 4;
8 21+5.25*7 0 4;
9 21+5.25*8 0 4];
Nodes = reprow(Nodes, 1:9, 1, [9 0 4.2 0]);
Nodes = reprow(Nodes, 10:18, 1, [9 0 4.5 0]);
Nodes = reprow(Nodes, 19:27, 1, [9 0 4.2 0]);
Nodes = reprow(Nodes, 28:36, 1, [9 0 3.7 0]);
%STEP N2: the 3 top points of triangle, then copy to second triangle
Nodes= [Nodes;
46 31.5 0 14.5;
47 42 0 25;
48 52.5 0 14.5];
Nodes = reprow(Nodes, 46:48, 1, [3 0 12.9 0]);
%STEP N3: reprow the full triangle + deck two times
%no overlapping nodes
%second triangle + deck
Nodes = reprow(Nodes, 1:8,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 10:17,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 19:26,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 28:35,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 37:44,1,[51 47.25 0 0]);
Nodes = reprow(Nodes, 46:51,1,[51 42 0 0]);
%third triangle + deck
Nodes = reprow(Nodes, 1:8,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 10:17,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 19:26,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 28:35,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 37:44,1,[102 89.25 0 0]);
Nodes = reprow(Nodes, 46:51,1,[102 84 0 0]);
%STEP N4: add the other notes of the deck parts not directly supported by
%the triangles to the left and right
%The left
Nodes = [Nodes;
154 0 0 4;
155 5.25 0 4;
156 10.5 0 4;
157 15.75 0 4;
158 0 4.2 4;
159 5.25 4.2 4;
160 10.5 4.2 4;
161 15.75 4.2 4;
162 0 8.7 4;
163 5.25 8.7 4;
164 10.5 8.7 4;
165 15.75 8.7 4;
166 0 12.9 4;
167 5.25 12.9 4;
168 10.5 12.9 4;
169 15.75 12.9 4;
170 0 16.6 4;
171 5.25 16.6 4;
172 10.5 16.6 4;
173 15.75 16.6 4];
%The right
Nodes = [Nodes;
174 152.25 0 4;
175 157.5 0 4;
176 162.75 0 4;
177 168 0 4;
178 152.25 4.2 4;
179 157.5 4.2 4;
180 162.75 4.2 4;
181 168 4.2 4;
182 152.25 8.7 4;
183 157.5 8.7 4;
184 162.75 8.7 4;
185 168 8.7 4;
186 152.25 12.9 4;
187 157.5 12.9 4;
188 162.75 12.9 4;
189 168 12.9 4;
190 152.25 16.6 4;
191 157.5 16.6 4;
192 162.75 16.6 4;
193 168 16.6 4];
%STEP N5: reference nodes
%Longitudinal beams and diagonal beams triangle 1 to 47 and copies
Nodes= [Nodes;
500 0 0 100;
501 0 4.2 100;
502 0 8.7 100;
503 0 12.9 100;
504 0 16.6 100];
%Beam element from 47 to 9 and all the copies
%also the ones going from 46 to 5 and the copies
Nodes= [Nodes;
505 168 0 100;
506 168 12.9 100];
%Transversal beams
Nodes= [Nodes;
507 31.5 0 100;
508 42 0 100;
509 52.5 0 100;
510 31.5+42 0 100;
511 42+42 0 100;
512 52.5+42 0 100;
513 31.5+42*2 0 100;
514 42+42*2 0 100;
515 52.5+42*2 0 100];
%STEP E1: initializing
% Element types -> {EltTypID EltName}
Types= {1 ‘beam’;
2 ‘truss’};
% Sections=[SecID A ky kz Ixx Iyy Izz] !!!all in m
Sections = [1 0.265*0.990*2 Inf Inf 2*(1/12*0.265*0.990^3) 2*(1/12*0.265*0.990^3) 2*(1/12*0.265*0.990^3); % plywood king post beam
2 0.265*0.540*2 Inf Inf 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3); % plywood diagonal beam
3 0.265*0.540*2 Inf Inf 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3) 2*(1/12*0.265*0.540^3); % horizontal beam
4 ((0.314/2)^2*pi-(0.314/2-0.019)^2*pi) NaN NaN NaN NaN NaN; % steel vertical
5 ((0.314/2)^2*pi-(0.314/2-0.019)^2*pi) NaN NaN NaN NaN NaN; % diagonal steel truss (only A)
6 0.265*0.1350*2 Inf Inf 2*(1/12*0.265*0.1350^3) 2*(1/12*0.265*0.1350^3) 2*(1/12*0.265*0.1350^3); % outer deck beam
7 0.240*0.1350*2 Inf Inf 2*(1/12*0.240*0.1350^3) 2*(1/12*0.240*0.1350^3) 2*(1/12*0.240*0.1350^3); % inner deck beam
8 0.200*0.650 Inf Inf 1/12*0.200*0.650^3 1/12*0.200*0.650^3 1/12*0.200*0.650^3; % outer footbridge
9 0.100*0.100 NaN NaN NaN NaN NaN]; % deck truss steel
% Materials=[MatID E nu rho];
Materials= [1 7.75e6 0.2 2000; % plywood
2 210e6 0.3 7500]; % steel KN/m2
% Elements=[EltID TypID SecID MatID n1 n2 n3]
%STEP E2: deck longitudonal plywood beams
%First triangle
Elements= [1 1 6 1 1 2 500;
2 1 7 1 10 11 501;
3 1 7 1 19 20 502;
4 1 6 1 28 29 503;
5 1 8 1 37 38 504];
Elements=reprow(Elements,1:5,7,[5 0 0 0 1 1 0]);
%Second triangle
Elements=[Elements;
41 1 6 1 9 52 500;
42 1 7 1 18 61 501;
43 1 7 1 27 70 502;
44 1 6 1 36 79 503;
45 1 8 1 45 88 504];
Elements= [Elements;
46 1 6 1 52 53 500;
47 1 7 1 61 62 501;
48 1 7 1 70 71 502;
49 1 6 1 79 80 503;
50 1 8 1 88 89 504];
Elements=reprow(Elements,46:50,6,[5 0 0 0 1 1 0]);
%Third triangle
Elements=[Elements;
81 1 6 1 59 103 500;
82 1 7 1 68 112 501;
83 1 7 1 77 121 502;
84 1 6 1 86 130 503;
85 1 8 1 95 139 504];
Elements= [Elements;
86 1 6 1 103 104 500;
87 1 7 1 112 113 501;
88 1 7 1 121 122 502;
89 1 6 1 130 131 503;
90 1 8 1 139 140 504];
Elements=reprow(Elements,86:90,6,[5 0 0 0 1 1 0]);
%Deck on the right of the triangles
Elements= [Elements;
121 1 6 1 110 174 500;
122 1 7 1 119 178 501;
123 1 7 1 128 182 502;
124 1 6 1 137 186 503;
125 1 8 1 146 190 504];
Elements= [Elements;
126 1 6 1 174 175 500;
127 1 7 1 178 179 501;
128 1 7 1 182 183 502;
129 1 6 1 186 187 503;
130 1 8 1 190 191 504];
Elements=reprow(Elements,126:130,2,[5 0 0 0 1 1 0]);
%Deck on the left of the triangles
Elements= [Elements;
141 1 6 1 154 155 500;
142 1 7 1 158 159 501;
143 1 7 1 162 163 502;
144 1 6 1 166 167 503;
145 1 8 1 170 171 504];
Elements=reprow(Elements,141:145,2,[5 0 0 0 1 1 0]);
Elements= [Elements;
156 1 6 1 157 1 500;
157 1 7 1 161 10 501;
158 1 7 1 165 19 502;
159 1 6 1 169 28 503;
160 1 8 1 173 37 504];
%STEP E2: deck transversal steel trusses
%First triangle
Elements= [Elements;
161 2 9 1 1 10 NaN;
162 2 9 1 10 19 NaN;
163 2 9 1 19 28 NaN;
164 2 9 1 28 37 NaN];
Elements=reprow(Elements,161:164,8,[4 0 0 0 1 1 0]);
%Second triangle
Elements= [Elements;
197 2 9 1 52 61 NaN;
198 2 9 1 61 70 NaN;
199 2 9 1 70 79 NaN;
200 2 9 1 79 88 NaN];
Elements=reprow(Elements,197:200,7,[4 0 0 0 1 1 0]);
%Third triangle
Elements= [Elements;
229 2 9 1 103 112 NaN;
230 2 9 1 112 121 NaN;
231 2 9 1 121 130 NaN;
232 2 9 1 130 139 NaN];
Elements=reprow(Elements,229:232,7,[4 0 0 0 1 1 0]);
%Right of the triangles
Elements= [Elements;
261 2 9 1 174 178 NaN;
262 2 9 1 178 182 NaN;
263 2 9 1 182 186 NaN;
264 2 9 1 186 190 NaN];
Elements=reprow(Elements,261:264,3,[4 0 0 0 1 1 0]);
%Left of the triangles
Elements= [Elements;
277 2 9 1 154 158 NaN;
278 2 9 1 158 162 NaN;
279 2 9 1 162 166 NaN;
280 2 9 1 166 170 NaN];
Elements=reprow(Elements,277:280,3,[4 0 0 0 1 1 0]);
%STEP E3: Beams elements triangles
%Beam element from 1 to 47 and all the copies (king post truss up)
Elements= [Elements;
293 1 1 1 1 47 500;
294 1 1 1 9 98 500;
295 1 1 1 59 149 500;
296 1 1 1 28 50 503;
297 1 1 1 36 101 503;
298 1 1 1 86 152 503];
%Beam element from 47 to 9 and all the copies (king post truss down)
Elements= [Elements;
299 1 1 1 47 9 505;
300 1 1 1 98 59 505;
301 1 1 1 149 110 505;
302 1 1 1 50 36 506;
303 1 1 1 101 86 506;
304 1 1 1 152 137 506];
%Beam element from 5 to 48 and all the copies (side diagonal)
Elements= [Elements;
305 1 2 1 5 48 500;
306 1 2 1 55 99 500;
307 1 2 1 106 150 500;
308 1 2 1 32 51 503;
309 1 2 1 82 102 503;
310 1 2 1 133 153 503];
%Beam element from 46 to 5 and all the copies (side diagonal)
Elements= [Elements;
311 1 2 1 46 5 505;
312 1 2 1 97 55 505;
313 1 2 1 148 106 505;
314 1 2 1 49 32 506;
315 1 2 1 100 82 506;
316 1 2 1 151 133 506];
%Transversal beams between the triangles
Elements= [Elements;
317 1 3 1 46 49 507;
318 1 3 1 47 50 508;
319 1 3 1 48 51 509;
320 1 3 1 97 100 510;
321 1 3 1 98 101 511;
322 1 3 1 99 102 512;
323 1 3 1 148 151 513;
324 1 3 1 149 152 514;
325 1 3 1 150 153 515];
%STEP E4: Truss elements triangles
%Vertical steel trusses
%First triangle
Elements= [Elements;
326 2 4 2 46 3 NaN;
327 2 4 2 47 5 NaN;
328 2 4 2 48 7 NaN;
329 2 4 2 49 30 NaN;
330 2 4 2 50 32 NaN;
331 2 4 2 51 34 NaN];
%Second triangle
Elements= [Elements;
332 2 4 2 97 53 NaN;
333 2 4 2 98 55 NaN;
334 2 4 2 99 57 NaN;
335 2 4 2 100 80 NaN;
336 2 4 2 101 82 NaN;
337 2 4 2 102 84 NaN];
%Third triangle
Elements= [Elements;
338 2 4 2 148 104 NaN;
339 2 4 2 149 106 NaN;
340 2 4 2 150 108 NaN;
341 2 4 2 151 131 NaN;
342 2 4 2 152 133 NaN;
343 2 4 2 153 135 NaN];
%Diagonal trusses
%First triangle
Elements= [Elements;
344 2 5 2 46 50 NaN;
345 2 5 2 47 49 NaN;
346 2 5 2 47 51 NaN;
347 2 5 2 48 50 NaN];
%Second triangle
Elements= [Elements;
348 2 5 2 97 101 NaN;
349 2 5 2 101 99 NaN;
350 2 5 2 98 100 NaN;
351 2 5 2 98 102 NaN];
%Third triangle
Elements= [Elements;
352 2 5 2 148 152 NaN;
353 2 5 2 150 152 NaN;
354 2 5 2 149 151 NaN;
355 2 5 2 149 153 NaN];
%STEP E5: plot
figure
plotelem(Nodes,Elements(find(Elements(:,3)==1),:),Types,’bl’);
hold(‘on’);
plotelem(Nodes,Elements(find(Elements(:,3)==2),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==3),:),Types,’m’);
plotelem(Nodes,Elements(find(Elements(:,3)==4),:),Types,’r’);
plotelem(Nodes,Elements(find(Elements(:,3)==5),:),Types,’r’);
plotelem(Nodes,Elements(find(Elements(:,3)==6),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==7),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==8),:),Types,’bl’);
plotelem(Nodes,Elements(find(Elements(:,3)==9),:),Types,’r’);
title(‘Elements’)
figure
plotnodes(Nodes);
title(‘Nodes’)
%STEP D1: generate all possible DOF
DOFall = getdof(Elements,Types);
%STEP D2: remove the DOF limited by the boundary conditions
selnodes = [1;9;28;36;59;86;110;137;154;158;162;166;170;177;181;185;189;193];
dofpattern = [0.01 0.02 0.03]; % the three dof’s
seldof = selnodes + dofpattern; % for the selected nodes, the pattern of dof
seldof = seldof(:);
DOF = removedof(DOFall,seldof);
%STEP K1: assemble the K matrix
K = asmkm(Nodes,Elements,Types,Sections,Materials,DOF);
%STEP K2: check the K matrix
%check symmetry
disp(K-K’)
det(K)
issymmetric(K)
%positive definite
find(eig(K)<0)
%to check wheter invertible
%Now we assign the correct loads to the structure
%STEP L1: compute the self weight of the structure
% Own weight
DLoadsOwn=accel([0 0 9.81e-3],Elements,Types,Sections,Materials);
%STEP L2: compute the distributed load working on the deck
%Combine with own weight and turn into elemloads
%DLoads=[EltID n1globalX n1globalY n1globalZ …]
DLoadsTraffic = zeros([160 7]);
DLoadsTraffic =[DLoadsTraffic;
161 0 0 -2.5 0 0 -2.5;
162 0 0 -2.5 0 0 -2.5;
163 0 0 -2.5 0 0 -2.5;
164 0 0 -9 0 0 -9];
DLoadsTraffic=reprow(DLoadsTraffic,161:164,32,[4 0 0 0 0 0 0]);
DLoadsTraffic = [DLoadsTraffic;
zeros([355-292 7])];
DLoadsOwn(161:292,1)=0;
DLoads = DLoadsOwn + DLoadsTraffic
P=elemloads(DLoads,Nodes,Elements,Types,DOF);
%P = P1+P2
%STEP L3: compute the point loads working on the deck
% Nodal loads: 5 kN horizontally on node 4.
%seldof=[4.01];
%PLoad= [5];
% Assembly of the load vectors:
%P=nodalvalues(DOF,seldof,PLoad);
%PLoad=[0]
%seldof=[]
%Pp=nodalvalues(DOF,seldof,PLoad);
%STEP L4: Compute P
%STEP U1: Compute the displacements
U=KP;
% Plot displacements
figure
plotdisp(Nodes,Elements,Types,DOF,U,’DispScal’,5)
title(‘Displacements’)
exportgraphics(gcf,’FE_DYB_Displ.jpg’,’Resolution’,300)
printdisp(Nodes,DOF,U);
% Compute element forces
Forces=elemforces(Nodes,Elements,Types,Sections,Materials,DOF,U,DLoads);
printforc(Elements,Forces);
% Plot element forces
figure
plotforc(‘norm’,Nodes,Elements,Types,Forces,DLoads)
title(‘Normal forces’)
exportgraphics(gcf,’FE_DYB_Normal.jpg’,’Resolution’,300)
figure
plotforc(‘sheary’,Nodes,Elements,Types,Forces,DLoads)
title(‘Shear forces’)
exportgraphics(gcf,’FE_DYB_Shear.jpg’,’Resolution’,300)
figure
plotforc(‘momz’,Nodes,Elements,Types,Forces,DLoads)
title(‘Bending moments’)
exportgraphics(gcf,’FE_DYB_Moment.jpg’,’Resolution’,300) stabil, finite elements, structures, nan MATLAB Answers — New Questions
How to Check if Shared Mailboxes Need MDO Licenses
Use PowerShell to Check Shared Mailboxes for Microsoft Defender for Office 365 Protection
I’ve spent a lot of time pursuing clarification about the licensing requirements for shared mailboxes when Microsoft Defender for Office 365 (MDO) is active within a Microsoft 365 tenant. Essentially, once a Microsoft 365 or Office 365 E5 license is assigned to a user account, MDO is activated and delivers protection to the mailboxes that come within the scope of its policies. The default is to protect all mailboxes, including shared mailboxes, and every mailbox that “benefits” from MDO protection must be licensed. This is the change Microsoft made to the MDO licensing terms, which originally required MDO licenses for all user and shared mailboxes in the tenant.
User accounts with Office 365 E5 or Microsoft 365 E5 licenses are licensed because both the MDO Plan 1 (identifier f20fedf3-f3c3-43c3-8267-2bfdd51c0939) and the MDO Plan 2 service plan (identifier 8e0c0a52-6a6c-4d40-8370-dd62790dcd70) are included in the set of service plans (apps) covered by these licenses (Figure 1).

Licensing Shared Mailboxes
Shared mailboxes, or rather the disabled Entra ID accounts used to these mailboxes, must be licensed if they receive MDO protection. The tenant doesn’t need to assign licenses to the accounts. All that’s needed is for the tenant to have sufficient MDO licenses (product SKU identifier 3dd6cf57-d688-4eed-ba52-9e40b5468c3e, THREAT_INTELLIGENCE) to cover the licensing requirement (see this page for product identifiers).
To reduce the potential liability for MDO licenses, tenants can exclude shared mailboxes that don’t benefit from MDO protection. For example, organizations often convert user mailboxes to shared mailboxes when people leave (inactive mailboxes are a better option for this purpose), some shared mailboxes are only used for internal communications, and some shared mailboxes are simply not in active use. Shared mailboxes in these categories don’t benefit from the Threat Processing and other Microsoft Defender for Office 365 features, so they don’t need to be licensed.
Use PowerShell to Find Shared Mailboxes That Should be Licensed
One simple test of whether shared mailboxes need MDO licenses is if the mailboxes receive external email. By definition, MDO processes external email as it passes through the transport pipeline, so any message received from a domain that doesn’t belong to the tenant is evidence that a mailbox has received benefit from MDO.
Two methods are available to check for external email. You could check the mailbox for messages from external domains or use Exchange’s message trace logs to analyze the traffic going to shared mailboxes to isolate any external messages. The second method is simpler than the first, so that’s what I used. The limitation is that the data retrieved by the Get-MessageTraceV2 cmdlet only goes back ten days.
An advantage of using message trace logs is that the processing to find shared mailboxes and check each mailbox can be done with the Exchange Online management module, providing that the signed-in user holds the Exchange administrator role. Things get more complicated when the script needs to check if the accounts are licensed for MDO. And it’s even more complicated if you want to run the script as a scheduled Azure Automation task or allow accounts that aren’t Exchange administrators to run the script.
License checking is easily done using the Microsoft Graph PowerShell SDK. The SDK also has all the necessary cmdlets to create and send email with the processing results. Making it possible for non-privileged accounts to run the script means using an app to authenticate against both the Graph and Exchange Online so that the code can run in app-only mode. Apart from that, the app must have the Exchange.ManageAsApp permission to manage Exchange as an app and its service principal must be added to the Exchange administrator role.
The full set of application permissions that must be assigned to the app is:
- Microsoft Graph: User.Read.All (fetch license information for accounts), Mail,Send (send email), and Domain.Read.All (read domain information to find default domain for the tenant).
- Office 365 Exchange Online: Exchange.ManageAsApp
If you want, the script can be easily converted to run as an Azure Automation runbook or using delegated permissions (in which case the signed in account must be an Exchange administrator).
The output is a report listing the set of shared mailboxes that do not have MDO licenses that have received external email over the last ten days (Figure 2).

You can download the script from the Office 365 for IT Pros GitHub repository.
Don’t Overspend on Microsoft Defender for Office 365 Licenses
Some Microsoft 365 tenants have thousands of shared mailboxes. Although E3 is still the norm for many organizations, an increased number of tenants are moving to use E5 licenses and therefore use Microsoft Defender for Office 365. It’s important to keep an eye on the potential MDO licensing liability and only license the mailboxes that receive benefit from MDO. Hopefully, this script helps.
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.
How to find rates of return to baseline after peaks, in temperature data over long timecourse?
Hello all, new MatLab user here, find the tutorials and documentation very useful so far! I am trying to evaluate the performance of a freezer in my lab. I wish to know the rate at which it cools back down to its setpoint after a spike in temperature. I want to be able to determine these rates for events over two years
I’ve been able to import the data into matlab as a table with the datetime and temperature, and then use the "find local extrema" task to identify the peaks. But I am now stuck on how I can find the rates of change after these peaks in an automated fashion. I also converted the data into timetables and tried doing this in the Signal Analyzer app. Would anyone be able to point me in the right direction?
I’ve included a plot to provide an idea of the data I’m working with. This plot has ~250,000 data pointsHello all, new MatLab user here, find the tutorials and documentation very useful so far! I am trying to evaluate the performance of a freezer in my lab. I wish to know the rate at which it cools back down to its setpoint after a spike in temperature. I want to be able to determine these rates for events over two years
I’ve been able to import the data into matlab as a table with the datetime and temperature, and then use the "find local extrema" task to identify the peaks. But I am now stuck on how I can find the rates of change after these peaks in an automated fashion. I also converted the data into timetables and tried doing this in the Signal Analyzer app. Would anyone be able to point me in the right direction?
I’ve included a plot to provide an idea of the data I’m working with. This plot has ~250,000 data points Hello all, new MatLab user here, find the tutorials and documentation very useful so far! I am trying to evaluate the performance of a freezer in my lab. I wish to know the rate at which it cools back down to its setpoint after a spike in temperature. I want to be able to determine these rates for events over two years
I’ve been able to import the data into matlab as a table with the datetime and temperature, and then use the "find local extrema" task to identify the peaks. But I am now stuck on how I can find the rates of change after these peaks in an automated fashion. I also converted the data into timetables and tried doing this in the Signal Analyzer app. Would anyone be able to point me in the right direction?
I’ve included a plot to provide an idea of the data I’m working with. This plot has ~250,000 data points curve fitting, signal processing, help MATLAB Answers — New Questions
Does MATLAB have functions to generate, manipulate and visualize HEALPix (Hierarchical Equal Area isoLatitude Pixelization) data?
I would like to use MATLAB to work with and visualize HEALPix data (described in the HEALPix landing page).
Does MATLAB have any functions that can handle such data?I would like to use MATLAB to work with and visualize HEALPix data (described in the HEALPix landing page).
Does MATLAB have any functions that can handle such data? I would like to use MATLAB to work with and visualize HEALPix data (described in the HEALPix landing page).
Does MATLAB have any functions that can handle such data? healpix, equal, area, map, grid, pixel MATLAB Answers — New Questions
[Simscape] Create a new two-phase fluid as a combination of two existing fluid types
Hi everyone,
I’m trying to run a test with R-513a, which doesn’t currently exist on the 2P fluid properties block, however, the two fluids which it is a mixture of R-1234yf and R-134a do. Is there a way to leverage the twoPhaseFluidTables function to add this particular refrigerant to simscape for testing?Hi everyone,
I’m trying to run a test with R-513a, which doesn’t currently exist on the 2P fluid properties block, however, the two fluids which it is a mixture of R-1234yf and R-134a do. Is there a way to leverage the twoPhaseFluidTables function to add this particular refrigerant to simscape for testing? Hi everyone,
I’m trying to run a test with R-513a, which doesn’t currently exist on the 2P fluid properties block, however, the two fluids which it is a mixture of R-1234yf and R-134a do. Is there a way to leverage the twoPhaseFluidTables function to add this particular refrigerant to simscape for testing? simscape, fluids, refrigeration, simulink MATLAB Answers — New Questions
Is There a Way to Create a Sequence of Polar Plots in a Tiled Layout Using arrayfun with an Anonymous Function?
Sample data
s.th = pi/4:pi/4:2*pi;
s.r = [19 6 12 18 16 11 15 15];
s(2) = s(1); s(2).th = s(2).th*1.3;
If I want to make two plots in a tiled layout with Axes I can do this
figure
t = tiledlayout(1,2);
arrayfun(@(s) scatter(nexttile,s.th,s.r),s)
However, if I want to make polar scatter plots
figure
t = tiledlayout(1,2);
try
arrayfun(@(s) polarscatter(nexttile,s.th,s.r),s)
catch ME
ME.message
end
Right. nextile does not return a PolarAxes object.
But there doesn’t seem to be a way to force nexttile to create a PolarAxes nor can I find a function like a hypothetical nextpolar to use as the first argument to polarscatter.
Instead, as best I can tell a loop is required
figure
t = tiledlayout(1,2);
for ii = 1:2
h1 = nexttile;
polarscatter(s(ii).th,s(ii).r)
end
What’s interesting here is that nexttile creates an Axes and then deep in the bowels of polarscatter a PolarAxes is created based on some properties of that Axes, and then Axes is deleted
h1
Is there a way to create a sequence of polar plots in a tiled layout using arrayfun with an anonymous function?Sample data
s.th = pi/4:pi/4:2*pi;
s.r = [19 6 12 18 16 11 15 15];
s(2) = s(1); s(2).th = s(2).th*1.3;
If I want to make two plots in a tiled layout with Axes I can do this
figure
t = tiledlayout(1,2);
arrayfun(@(s) scatter(nexttile,s.th,s.r),s)
However, if I want to make polar scatter plots
figure
t = tiledlayout(1,2);
try
arrayfun(@(s) polarscatter(nexttile,s.th,s.r),s)
catch ME
ME.message
end
Right. nextile does not return a PolarAxes object.
But there doesn’t seem to be a way to force nexttile to create a PolarAxes nor can I find a function like a hypothetical nextpolar to use as the first argument to polarscatter.
Instead, as best I can tell a loop is required
figure
t = tiledlayout(1,2);
for ii = 1:2
h1 = nexttile;
polarscatter(s(ii).th,s(ii).r)
end
What’s interesting here is that nexttile creates an Axes and then deep in the bowels of polarscatter a PolarAxes is created based on some properties of that Axes, and then Axes is deleted
h1
Is there a way to create a sequence of polar plots in a tiled layout using arrayfun with an anonymous function? Sample data
s.th = pi/4:pi/4:2*pi;
s.r = [19 6 12 18 16 11 15 15];
s(2) = s(1); s(2).th = s(2).th*1.3;
If I want to make two plots in a tiled layout with Axes I can do this
figure
t = tiledlayout(1,2);
arrayfun(@(s) scatter(nexttile,s.th,s.r),s)
However, if I want to make polar scatter plots
figure
t = tiledlayout(1,2);
try
arrayfun(@(s) polarscatter(nexttile,s.th,s.r),s)
catch ME
ME.message
end
Right. nextile does not return a PolarAxes object.
But there doesn’t seem to be a way to force nexttile to create a PolarAxes nor can I find a function like a hypothetical nextpolar to use as the first argument to polarscatter.
Instead, as best I can tell a loop is required
figure
t = tiledlayout(1,2);
for ii = 1:2
h1 = nexttile;
polarscatter(s(ii).th,s(ii).r)
end
What’s interesting here is that nexttile creates an Axes and then deep in the bowels of polarscatter a PolarAxes is created based on some properties of that Axes, and then Axes is deleted
h1
Is there a way to create a sequence of polar plots in a tiled layout using arrayfun with an anonymous function? polar plot, arrayfun, tiled layout MATLAB Answers — New Questions
Incompatible array sizes error in hppcTest
Hello team,
I am using the Simscape battery toolbox to estimate ECM Parameters from HPPC test data following the similar example provided.
When I load my hppc data, and run hppcTest, I get the error Arrays have incompatible sizes for this operation.
The data has many pulses. However, when I choose only data for 1 pulse, it works fine.
Here is my code snippet –
“`
% Load the CSV file
data = readtable(‘240419_1C_Disharge_HPPC_25.csv’);
% Create simple table with renamed columns
hppcData = table(data.Ch7_Time_Second_, data.Ch7_Voltage_V_, data.Ch7_Current_A_, …
‘VariableNames’, {‘Time’, ‘Voltage’, ‘Current’});
% Display to verify
disp(‘Table created:’);
disp(head(hppcData));
disp(‘Size of table:’);
disp(size(hppcData));
% Create hppcTest object
hppcExp25degC = hppcTest(hppcData, …
‘TimeVariable’, ‘Time’, …
‘VoltageVariable’, ‘Voltage’, …
‘CurrentVariable’, ‘Current’, …
‘Capacity’, 50, …
‘InitialSOC’, 1.0);
“`Hello team,
I am using the Simscape battery toolbox to estimate ECM Parameters from HPPC test data following the similar example provided.
When I load my hppc data, and run hppcTest, I get the error Arrays have incompatible sizes for this operation.
The data has many pulses. However, when I choose only data for 1 pulse, it works fine.
Here is my code snippet –
“`
% Load the CSV file
data = readtable(‘240419_1C_Disharge_HPPC_25.csv’);
% Create simple table with renamed columns
hppcData = table(data.Ch7_Time_Second_, data.Ch7_Voltage_V_, data.Ch7_Current_A_, …
‘VariableNames’, {‘Time’, ‘Voltage’, ‘Current’});
% Display to verify
disp(‘Table created:’);
disp(head(hppcData));
disp(‘Size of table:’);
disp(size(hppcData));
% Create hppcTest object
hppcExp25degC = hppcTest(hppcData, …
‘TimeVariable’, ‘Time’, …
‘VoltageVariable’, ‘Voltage’, …
‘CurrentVariable’, ‘Current’, …
‘Capacity’, 50, …
‘InitialSOC’, 1.0);
“` Hello team,
I am using the Simscape battery toolbox to estimate ECM Parameters from HPPC test data following the similar example provided.
When I load my hppc data, and run hppcTest, I get the error Arrays have incompatible sizes for this operation.
The data has many pulses. However, when I choose only data for 1 pulse, it works fine.
Here is my code snippet –
“`
% Load the CSV file
data = readtable(‘240419_1C_Disharge_HPPC_25.csv’);
% Create simple table with renamed columns
hppcData = table(data.Ch7_Time_Second_, data.Ch7_Voltage_V_, data.Ch7_Current_A_, …
‘VariableNames’, {‘Time’, ‘Voltage’, ‘Current’});
% Display to verify
disp(‘Table created:’);
disp(head(hppcData));
disp(‘Size of table:’);
disp(size(hppcData));
% Create hppcTest object
hppcExp25degC = hppcTest(hppcData, …
‘TimeVariable’, ‘Time’, …
‘VoltageVariable’, ‘Voltage’, …
‘CurrentVariable’, ‘Current’, …
‘Capacity’, 50, …
‘InitialSOC’, 1.0);
“` simscape, hppc, ecm MATLAB Answers — New Questions
Teams Messaging Gains New Protections
Weaponized File Protection and Malicious URL Protection Rolling Out Now
The best thing about a technology conference are the people you meet. Even though I didn’t particularly like the Microsoft Ignite 2025 conference in San Francisco, I met some very interesting people, including Martina, a program manager from the Teams development group. As with many valuable conversations, the chat was brief but information rich.
During the conversation, I was mildly chided that I hadn’t covered two recent features she had worked on to protect Teams. Controls to manage the splendidly named Weaponizable file protection and the Malicious URL protection features are in the Messaging Safety section of the Teams admin center (Figure 1).

By default, both features are disabled during the targeted release phase. When the features reach general availability, the features will be enabled by default and will apply to both internal and federated chats. After enabling protection, it takes a few hours for Teams clients to respect the new setting.
The announcements for the features are in MC1148540 (Weaponizable file protection, updated 17 November 2025, Microsoft 365 roadmap item 499892) and MC1148539 (Malicious URL protection, last updated 17 November 2025, Microsoft 365 roadmap item 499893). General availability for both is due by the end of November 2025.
Weaponizable File Protection
A weaponizable file is one that can be used by attackers. Think of an executable or zip file that could have some malware lurking within. The protection feature automatically blocks users from sharing files of specific types through chats and channel conversations. The list of blocked file types is:
ace, ani, apk, app, appx, arj, bat, cab, cmd, com, deb, dex, dll, docm, elf, exe, hta, img, iso, jar, jnlp, kext, lha, lib, library, lnk, lzh, macho, msc, msi, msix, msp, mst, pif, ppa, ppam, reg, rev, scf, scr, sct, sys, uif, vb, vbe, vbs, vxd, wsc, wsf, wsh, xll, xz, z
Currently, tenants cannot update the list to add or remove blocked file types.
By stopping people sharing suspect files through Teams, the probability of some infectious content finding its way into the tenant is reduced. Protection checks are applied by all Teams clients, including the mobile clients.
The way things work is quite simple. Figure 2 shows several messages in a conversation. The top message occurred before the weaponized file protection took effect, and I was able to send an .msi file to the chat participants. Once the file protection kicked in, Teams began to check the file types (the check happens after the user sends a message) and blocked files. The second message shows what a recipient sees when Teams blocks a message from another participant. The last shows how Teams flags the problem after a user attempts to send a blocked file.

Malicious URL Protection
The second protection checks URLs shared in chats and channel conversations to verify that the links are not potentially harmful. Protection is available in all Teams clients. If Teams detects a problematic link, it displays a warning to
When a malicious link is detected, Teams automatically displays a warning to both the sender and recipient to help reduce the risk of phishing attacks.
I was less successful testing malicious URL protection. According to the documentation, Teams automatically scans URLs included in messages against threat intelligence databases to identify potentially malicious links. I tried with many of the malicious URLs shared on the URLhaus site but didn’t manage to provoke any warnings (Figure 3).

It’s possible that the intelligence databases used by Teams didn’t pick up the URLs I tested because the URLs had just been added to URLhaus, but then I tried posting the example URL shown in MC1148539, and Teams failed to detect a problem with that link too. I’m sure that this is a temporary glitch.
Update Protection Settings with PowerShell
Unlike other messaging settings which are applied through policies assigned to user accounts, the settings to control weaponized file protection and malicious URL protection are controlled through the Teams messaging tenant-wide configuration. This is probably because it doesn’t make sense to protect some users and not others within a single tenant.
To control the settings with PowerShell, run the Set-CsTeamsMessagingConfiguration from the Teams PowerShell module and update the settings for FileTypeCheck (weaponized file protection) and UrlReputationCheck (malicious URL protection). The Get-CsTeamsMessagingConfiguration reports the current settings. For example:
Set-CsTeamsMessagingConfiguration -Identity Global -FileTypeCheck Enabled -UrlReputationCheck Enabled Get-CsTeamsMessagingConfiguration Identity : Global EnableVideoMessageCaptions : True EnableInOrganizationChatControl : True CustomEmojis : True Storyline : Enabled MessagingNotes : Enabled FileTypeCheck : Enabled UrlReputationCheck : Enabled ContentBasedPhishingCheck : Disabled ReportIncorrectSecurityDetections : Disabled
Extra Protection is Goodness
Introducing extra levels of protection within Teams messaging can never be a bad thing. It’s sensible to scan files and URLs shared in messages for problems. No one wants to have malware spread within a tenant by someone sharing a bad file or URL (to up to 50 channels in one action), so these are good changes that all Microsoft 365 tenants should have by early December 2025.
Learn about managing Teams and the rest of the Microsoft 365 ecosystem by subscribing to the Office 365 for IT Pros eBook. Use our experience to understand what’s important and how best to protect your tenant.
License Manager Error -114
License checkout failed
License Manager Error -114License checkout failed
License Manager Error -114 License checkout failed
License Manager Error -114 simulink, license MATLAB Answers — New Questions
Prescribed time disturbance observer does not estimate in prescribed settling time.
Hi, I hope you are feeling well. I have designed a prescribed time disturbance observer based on the idea that was used to design a prescribed time controller. First, I have apllied the controller to a first order and then to a third order system.
*The problem I have is that the disturbance observer does not work in a prescribed time, I change the settling time, but it still works in a fixed settling time that is around 1.5 seconds. I have attached the simulink model here. I really appreciate your help if you can tell me how I can solve the problem.*Hi, I hope you are feeling well. I have designed a prescribed time disturbance observer based on the idea that was used to design a prescribed time controller. First, I have apllied the controller to a first order and then to a third order system.
*The problem I have is that the disturbance observer does not work in a prescribed time, I change the settling time, but it still works in a fixed settling time that is around 1.5 seconds. I have attached the simulink model here. I really appreciate your help if you can tell me how I can solve the problem.* Hi, I hope you are feeling well. I have designed a prescribed time disturbance observer based on the idea that was used to design a prescribed time controller. First, I have apllied the controller to a first order and then to a third order system.
*The problem I have is that the disturbance observer does not work in a prescribed time, I change the settling time, but it still works in a fixed settling time that is around 1.5 seconds. I have attached the simulink model here. I really appreciate your help if you can tell me how I can solve the problem.* control, disturbance observer, prescribed time MATLAB Answers — New Questions
HDF5 Library error
Hi,
I recently moved to matlab 2022a and without touching the code an error arrised. Indeed when trying to create a paraview file (h5), I get the following error. Is it a known issue of the new version ?
Error using hdf5lib2
Unable to open the file because of HDF5 Library error. Reason:Unknown
Error in H5F.open (line 130)
file_id = H5ML.hdf5lib2(‘H5Fopen’, filename, flags, fapl, is_remote);
Error in h5write (line 108)
file_id = H5F.open(Filename,flags,fapl);
Error in xdmf3writer>h5creation (line 85)
h5write(sprintf(‘%s.h5′,filename),’/Geometry’,Grid.geometry’);
Error in xdmf3writer (line 13)
h5creation(filepath,Grid);
Error in save_xdmf (line 33)
xdmf3writer(sprintf(‘%s-%d’,filename,id_model),Grids);
Error in paraview_save (line 49)
save_xdmf(model,result,file_name);Hi,
I recently moved to matlab 2022a and without touching the code an error arrised. Indeed when trying to create a paraview file (h5), I get the following error. Is it a known issue of the new version ?
Error using hdf5lib2
Unable to open the file because of HDF5 Library error. Reason:Unknown
Error in H5F.open (line 130)
file_id = H5ML.hdf5lib2(‘H5Fopen’, filename, flags, fapl, is_remote);
Error in h5write (line 108)
file_id = H5F.open(Filename,flags,fapl);
Error in xdmf3writer>h5creation (line 85)
h5write(sprintf(‘%s.h5′,filename),’/Geometry’,Grid.geometry’);
Error in xdmf3writer (line 13)
h5creation(filepath,Grid);
Error in save_xdmf (line 33)
xdmf3writer(sprintf(‘%s-%d’,filename,id_model),Grids);
Error in paraview_save (line 49)
save_xdmf(model,result,file_name); Hi,
I recently moved to matlab 2022a and without touching the code an error arrised. Indeed when trying to create a paraview file (h5), I get the following error. Is it a known issue of the new version ?
Error using hdf5lib2
Unable to open the file because of HDF5 Library error. Reason:Unknown
Error in H5F.open (line 130)
file_id = H5ML.hdf5lib2(‘H5Fopen’, filename, flags, fapl, is_remote);
Error in h5write (line 108)
file_id = H5F.open(Filename,flags,fapl);
Error in xdmf3writer>h5creation (line 85)
h5write(sprintf(‘%s.h5′,filename),’/Geometry’,Grid.geometry’);
Error in xdmf3writer (line 13)
h5creation(filepath,Grid);
Error in save_xdmf (line 33)
xdmf3writer(sprintf(‘%s-%d’,filename,id_model),Grids);
Error in paraview_save (line 49)
save_xdmf(model,result,file_name); h5 file, paraview export, hdf5lib2, h5f.open MATLAB Answers — New Questions
First value of an array does not display with a decimal
I am trying to print an array which display the values of x y and z on every change of x and z, but the first value os always formated a different way if z is an integer. Here is the awnser I get:
And here is my code:
zp=input(‘Įveskite pradinę z vertę: ‘);
zg=input(‘Įveskite galutinę z vertę: ‘);
hz=input(‘Įveskite z vertės pokytį: ‘);
xp=4;
hx=0.3;
x=xp;
disp(‘ x y z’);
for z=zp:hz:zg
if z>=x
y=sin(x).*cos(x);
else
y=log10(xp).*log(z);
end
disp([x y z]);
x=x+hx;
endI am trying to print an array which display the values of x y and z on every change of x and z, but the first value os always formated a different way if z is an integer. Here is the awnser I get:
And here is my code:
zp=input(‘Įveskite pradinę z vertę: ‘);
zg=input(‘Įveskite galutinę z vertę: ‘);
hz=input(‘Įveskite z vertės pokytį: ‘);
xp=4;
hx=0.3;
x=xp;
disp(‘ x y z’);
for z=zp:hz:zg
if z>=x
y=sin(x).*cos(x);
else
y=log10(xp).*log(z);
end
disp([x y z]);
x=x+hx;
end I am trying to print an array which display the values of x y and z on every change of x and z, but the first value os always formated a different way if z is an integer. Here is the awnser I get:
And here is my code:
zp=input(‘Įveskite pradinę z vertę: ‘);
zg=input(‘Įveskite galutinę z vertę: ‘);
hz=input(‘Įveskite z vertės pokytį: ‘);
xp=4;
hx=0.3;
x=xp;
disp(‘ x y z’);
for z=zp:hz:zg
if z>=x
y=sin(x).*cos(x);
else
y=log10(xp).*log(z);
end
disp([x y z]);
x=x+hx;
end display, format, decimal, array MATLAB Answers — New Questions
Change value of stream mass flow in HYSYS using matlab
I want to set the value of stream ‘PFD136’ to flow_136. Seems I have a syntax error. Please helpI want to set the value of stream ‘PFD136’ to flow_136. Seems I have a syntax error. Please help I want to set the value of stream ‘PFD136’ to flow_136. Seems I have a syntax error. Please help hysys, hysysinterface, setvalue MATLAB Answers — New Questions
How do I contact the authors of the blog “Generative AI + Robotics = Awesome!”
The blog Generative AI + Robotics = Awesome! says "you can reach out to us directly to request trial code access" yet there is no details of whom to contact or how. I feel I may be missing something obvious. Can anybody help me to get in contact with the Authors.The blog Generative AI + Robotics = Awesome! says "you can reach out to us directly to request trial code access" yet there is no details of whom to contact or how. I feel I may be missing something obvious. Can anybody help me to get in contact with the Authors. The blog Generative AI + Robotics = Awesome! says "you can reach out to us directly to request trial code access" yet there is no details of whom to contact or how. I feel I may be missing something obvious. Can anybody help me to get in contact with the Authors. robotics vla blog. MATLAB Answers — New Questions
Help, how to make a buck chopper simulation using SCR only ?
i want to know how to make a buck chopper simulation in MATLAB using only SCR without mosfet/IGBT is it possible ?i want to know how to make a buck chopper simulation in MATLAB using only SCR without mosfet/IGBT is it possible ? i want to know how to make a buck chopper simulation in MATLAB using only SCR without mosfet/IGBT is it possible ? buck, chopper MATLAB Answers — New Questions
Simulink Hanging when I try to save a simple model
Version: MATLAB_R2025b
Laptop: Macbook Pro M3 Max
I just started learning to use MATLAB and Simulink. I am on a Macbook pro M3 Max (36GB of RAM, 14 CPU cores). MATLAB is the first program I have had on this laptop to be so slow and unresponsive.
I have found workarounds for many of the problems I faced, but when I try to save a very basic Simulink model (see photo), both MATLAB and Simulink become unresponsive (see photo) and I have to force quit and restart just to be able to do anything. Can I get some help with this?Version: MATLAB_R2025b
Laptop: Macbook Pro M3 Max
I just started learning to use MATLAB and Simulink. I am on a Macbook pro M3 Max (36GB of RAM, 14 CPU cores). MATLAB is the first program I have had on this laptop to be so slow and unresponsive.
I have found workarounds for many of the problems I faced, but when I try to save a very basic Simulink model (see photo), both MATLAB and Simulink become unresponsive (see photo) and I have to force quit and restart just to be able to do anything. Can I get some help with this? Version: MATLAB_R2025b
Laptop: Macbook Pro M3 Max
I just started learning to use MATLAB and Simulink. I am on a Macbook pro M3 Max (36GB of RAM, 14 CPU cores). MATLAB is the first program I have had on this laptop to be so slow and unresponsive.
I have found workarounds for many of the problems I faced, but when I try to save a very basic Simulink model (see photo), both MATLAB and Simulink become unresponsive (see photo) and I have to force quit and restart just to be able to do anything. Can I get some help with this? simulink, save, model MATLAB Answers — New Questions
Add Tooltip to each UI Tree Checkbox in App Designer
In App Desinger I want to add tooltips to each ui tree checkbox, so here each checkbox shall tell the user more of what is done or checked with the check exactly. Example: For "Block Colors" a tooltip might show something like "Checks if each Simulink Block has its dedicated color as defined by the company guidelines". Is there an option, as I can only find to add a tooltip to the parent CheckBoxTree but not each individual checkbox? Thank you.In App Desinger I want to add tooltips to each ui tree checkbox, so here each checkbox shall tell the user more of what is done or checked with the check exactly. Example: For "Block Colors" a tooltip might show something like "Checks if each Simulink Block has its dedicated color as defined by the company guidelines". Is there an option, as I can only find to add a tooltip to the parent CheckBoxTree but not each individual checkbox? Thank you. In App Desinger I want to add tooltips to each ui tree checkbox, so here each checkbox shall tell the user more of what is done or checked with the check exactly. Example: For "Block Colors" a tooltip might show something like "Checks if each Simulink Block has its dedicated color as defined by the company guidelines". Is there an option, as I can only find to add a tooltip to the parent CheckBoxTree but not each individual checkbox? Thank you. appdesigner, matlab gui, checkbox MATLAB Answers — New Questions









