Month: February 2026
USRP B210 GPSDO time?
I am working on a project using both the USRP B210 and the compatible GPSDO. I am time-stamping pulses detected when going through the SDR. Is there a way through either MATLAB or Simulink that I can pull the GPS timestamps from the SDR packets it streams to the PC? I already have the USRP Communications toolbox installed. I have gone through the toolbox documentation and it appears to have no information regarding parsing the packets. The Simulink block appears to only provide the sample of the signal, and not the timestamp of that sample.I am working on a project using both the USRP B210 and the compatible GPSDO. I am time-stamping pulses detected when going through the SDR. Is there a way through either MATLAB or Simulink that I can pull the GPS timestamps from the SDR packets it streams to the PC? I already have the USRP Communications toolbox installed. I have gone through the toolbox documentation and it appears to have no information regarding parsing the packets. The Simulink block appears to only provide the sample of the signal, and not the timestamp of that sample. I am working on a project using both the USRP B210 and the compatible GPSDO. I am time-stamping pulses detected when going through the SDR. Is there a way through either MATLAB or Simulink that I can pull the GPS timestamps from the SDR packets it streams to the PC? I already have the USRP Communications toolbox installed. I have gone through the toolbox documentation and it appears to have no information regarding parsing the packets. The Simulink block appears to only provide the sample of the signal, and not the timestamp of that sample. ettus, usrp, time, gps MATLAB Answers — New Questions
How can I do one-hot encoding in MATLAB?
I would like to perform one-hot encoding on the vector [1 7 10 9 8 6]’ with 10 classes (numbers 1 to 10). The resulting 6×10 matrix should have a 1×10 vector in place of each number, with "1" at the position corresponding to the number and "0" at all other positions.I would like to perform one-hot encoding on the vector [1 7 10 9 8 6]’ with 10 classes (numbers 1 to 10). The resulting 6×10 matrix should have a 1×10 vector in place of each number, with "1" at the position corresponding to the number and "0" at all other positions. I would like to perform one-hot encoding on the vector [1 7 10 9 8 6]’ with 10 classes (numbers 1 to 10). The resulting 6×10 matrix should have a 1×10 vector in place of each number, with "1" at the position corresponding to the number and "0" at all other positions. one, hot, encoding, corresponding, number, 1, 0 MATLAB Answers — New Questions
why is my for loop not working?
y=@(x) x^2-4;
x1=input(‘Enter the value of x1:’);
x2=input(‘Enter the value of x2:’);
x3=input(‘Enter the value of x3:’);
for i=1:100
L1=(x2-x3)/(x3-x1);
xf=x3+L1*(x3-x1);
y1=abs(y(x1));
y2= abs(y(x2));
y3=abs(y(x3));
yf=abs(y(xf));
ynext=sort([y1 y2 y3 yf]);
if y1==max(ynext)
x1=xf;
elseif y2==max(ynext)
x2=xf;
else
x3=xf;
end
if y(xf)<10^-10
break
end
end
fprintf(‘the root: %fn the number of iterations: %dn’,xf,i)y=@(x) x^2-4;
x1=input(‘Enter the value of x1:’);
x2=input(‘Enter the value of x2:’);
x3=input(‘Enter the value of x3:’);
for i=1:100
L1=(x2-x3)/(x3-x1);
xf=x3+L1*(x3-x1);
y1=abs(y(x1));
y2= abs(y(x2));
y3=abs(y(x3));
yf=abs(y(xf));
ynext=sort([y1 y2 y3 yf]);
if y1==max(ynext)
x1=xf;
elseif y2==max(ynext)
x2=xf;
else
x3=xf;
end
if y(xf)<10^-10
break
end
end
fprintf(‘the root: %fn the number of iterations: %dn’,xf,i) y=@(x) x^2-4;
x1=input(‘Enter the value of x1:’);
x2=input(‘Enter the value of x2:’);
x3=input(‘Enter the value of x3:’);
for i=1:100
L1=(x2-x3)/(x3-x1);
xf=x3+L1*(x3-x1);
y1=abs(y(x1));
y2= abs(y(x2));
y3=abs(y(x3));
yf=abs(y(xf));
ynext=sort([y1 y2 y3 yf]);
if y1==max(ynext)
x1=xf;
elseif y2==max(ynext)
x2=xf;
else
x3=xf;
end
if y(xf)<10^-10
break
end
end
fprintf(‘the root: %fn the number of iterations: %dn’,xf,i) for loop MATLAB Answers — New Questions
MATLAB 2025b not launching
I recently did a firmware update on my linux machine and after that I am not able to launch MATLAB 2025b.
This is the error I get:
MathWorks Licensing Error 9
A licensing error occurred while trying to use MATLAB.
The host ID ‘843a5b57c8e7’ in the license file does not match your computer’s host ID: c0a810c2b168.
To resolve this issue, reactivate your license.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/9
Details for Support
Feature: MATLAB
License: /home/srikar-k/.matlab/R2025b_licenses:/usr/local/MATLAB/R2025b/licenses/license.dat:/usr/local/MATLAB/R2025b/licenses/license_srikar-k-Dell-Pro-Max-16-Premium-MA16250_41282735_13252145_R2025b.lic
Error Code: -9.2
Unable to launch MVM server: License Error: Licensing shutdownI recently did a firmware update on my linux machine and after that I am not able to launch MATLAB 2025b.
This is the error I get:
MathWorks Licensing Error 9
A licensing error occurred while trying to use MATLAB.
The host ID ‘843a5b57c8e7’ in the license file does not match your computer’s host ID: c0a810c2b168.
To resolve this issue, reactivate your license.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/9
Details for Support
Feature: MATLAB
License: /home/srikar-k/.matlab/R2025b_licenses:/usr/local/MATLAB/R2025b/licenses/license.dat:/usr/local/MATLAB/R2025b/licenses/license_srikar-k-Dell-Pro-Max-16-Premium-MA16250_41282735_13252145_R2025b.lic
Error Code: -9.2
Unable to launch MVM server: License Error: Licensing shutdown I recently did a firmware update on my linux machine and after that I am not able to launch MATLAB 2025b.
This is the error I get:
MathWorks Licensing Error 9
A licensing error occurred while trying to use MATLAB.
The host ID ‘843a5b57c8e7’ in the license file does not match your computer’s host ID: c0a810c2b168.
To resolve this issue, reactivate your license.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/9
Details for Support
Feature: MATLAB
License: /home/srikar-k/.matlab/R2025b_licenses:/usr/local/MATLAB/R2025b/licenses/license.dat:/usr/local/MATLAB/R2025b/licenses/license_srikar-k-Dell-Pro-Max-16-Premium-MA16250_41282735_13252145_R2025b.lic
Error Code: -9.2
Unable to launch MVM server: License Error: Licensing shutdown license MATLAB Answers — New Questions
Code Error Allowed Copilot Chat to Expose Confidential Information
DLP Policy for Copilot Ignored By Software Glitch
An embarrassing security glitch appeared in Microsoft 365 when the DLP policy constructed to stop Copilot Chat processing email and files stamped with specific sensitivity labels failed to suppress confidential material appearing in Copilot responses. According to service health advisory CW1226324 (3 February 2026), the root cause is a “code issue” which allows “items in the Sent Items and Drafts folders to be picked up by Copilot even though confidential labels are set in place.” Items in other folders don’t appear to be affected.
Customers first reported the issue on 21 January 2026, so the flaw was active for a while before Microsoft accepted that the problem was real.
How the DLP Policy for Copilot Works
Figure 1 shows a DLP policy rule of the type affected by the problem. The rule mandates that any email or document (Office or PDF files) stamped with the Confidential label is excluded from Copilot for Microsoft 365 processing.

With the DLP Policy for Copilot in place, I created and sent a message stamped with the Confidential label. The message refers to a fictious Project Bunny. When I asked Copilot Chat to search for information about Project Bunny, Copilot responded that it could find an internal reference (the email) but cannot disclose the content because it is marked as sensitive internal correspondence (i.e., the sensitivity label).

Problem Fix Rolling Out
According to CW1226324, my tenant was affected. I didn’t notice the problem until it was drawn to my attention by a comment posted to Office365ITPros.com. By the time I tested, Microsoft had fixed the problem, and the fix had reached my tenant. According to an update posted on 10 February 2026, the remediation for the issue is rolling out. Or, in Microsoft terms, “saturates across the affected environments,” which is how they describe a software update reaching all the servers that need to be patched.
Microsoft promises to provide a follow-up update about the issue on 18 February 2026. If, as it seems, the problem is fixed, Microsoft might proceed to generate a post-incident report (PIR) to explain what happened. It would be interesting to know if the code issue has always existed or was introduced as the result of some change.
Software Problems Happen
Everyone working in IT realizes the potential for software issues to occur. But problems like this raise the question about how Microsoft tests software before release. Confidential messages do end up in the Sent Items folder, so on the surface it seems like checking email in that folder is an easy test for the DLP Policy for Copilot. It can be argued that Copilot Chat exposing messages in the Draft folder is less important because these items are personal to the signed-in user and haven’t been shared with other people. Nevertheless, a policy is a policy, and Copilot should not violate the DLP policy.
A Good Reminder
On the upside, the incident serves as a useful reminder to the Microsoft 365 tenants that support the 15 million paid seats for Microsoft 365 Copilot that confidential information should be protected from AI tools. The DLP policy for Copilot should be used in all of these tenants, as should Restricted Content Discovery (RCD) for SharePoint Online. RCD is a SharePoint Advanced Management feature that is available to every tenant with Microsoft 365 Copilot licenses to remove sites containing sensitive or confidential information from Copilot’s view.
For more information about how the DLP policy for Copilot works, see the Microsoft documentation.
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!
Valid MATLAB Runtime installer not found.
When trying to compile a stand alone ap in ap designer, it throws the error "Valid MATLAB Runtime installer not found". It prompts for MATLAB Runtime installer location. Here is what my IT guy installed:
At C:Program FilesMatlab
R2024b
MATLAB Compiler Runtime
MATLAB Runtime
The IT guy reported that he was unable to add paths to the ENVIRONMENT VARIABLES.
What do I need to do so that I can compile stand alone .exe applications?When trying to compile a stand alone ap in ap designer, it throws the error "Valid MATLAB Runtime installer not found". It prompts for MATLAB Runtime installer location. Here is what my IT guy installed:
At C:Program FilesMatlab
R2024b
MATLAB Compiler Runtime
MATLAB Runtime
The IT guy reported that he was unable to add paths to the ENVIRONMENT VARIABLES.
What do I need to do so that I can compile stand alone .exe applications? When trying to compile a stand alone ap in ap designer, it throws the error "Valid MATLAB Runtime installer not found". It prompts for MATLAB Runtime installer location. Here is what my IT guy installed:
At C:Program FilesMatlab
R2024b
MATLAB Compiler Runtime
MATLAB Runtime
The IT guy reported that he was unable to add paths to the ENVIRONMENT VARIABLES.
What do I need to do so that I can compile stand alone .exe applications? runtime installer path MATLAB Answers — New Questions
How to export Simulink models (with Stateflow components) to XML ?
Hello,
I would need to know how can I export Simulink models (and some of these latter may also have Stateflow components, such as State Charts etc.) to XML.
I have typed the following MATLAB commands:
modelName = ‘sf_aircraft’ % model of the name without extension
save_system(modelName, ‘xml_model.xml’, ‘ExportToXML’, true)
But I have the following warning :
Warning: The ‘ExportToXML’ option is no longer supported and will be removed in a future release.
And I have also noticed that in the XML file the State Chart component is just mentioned, so basically I cannot see what it contains from the XML file.
So what I would like to ask is if there are other functions or ways that allow Simulink models with State Charts components to be exported in a XML format.
Thanks in advance.Hello,
I would need to know how can I export Simulink models (and some of these latter may also have Stateflow components, such as State Charts etc.) to XML.
I have typed the following MATLAB commands:
modelName = ‘sf_aircraft’ % model of the name without extension
save_system(modelName, ‘xml_model.xml’, ‘ExportToXML’, true)
But I have the following warning :
Warning: The ‘ExportToXML’ option is no longer supported and will be removed in a future release.
And I have also noticed that in the XML file the State Chart component is just mentioned, so basically I cannot see what it contains from the XML file.
So what I would like to ask is if there are other functions or ways that allow Simulink models with State Charts components to be exported in a XML format.
Thanks in advance. Hello,
I would need to know how can I export Simulink models (and some of these latter may also have Stateflow components, such as State Charts etc.) to XML.
I have typed the following MATLAB commands:
modelName = ‘sf_aircraft’ % model of the name without extension
save_system(modelName, ‘xml_model.xml’, ‘ExportToXML’, true)
But I have the following warning :
Warning: The ‘ExportToXML’ option is no longer supported and will be removed in a future release.
And I have also noticed that in the XML file the State Chart component is just mentioned, so basically I cannot see what it contains from the XML file.
So what I would like to ask is if there are other functions or ways that allow Simulink models with State Charts components to be exported in a XML format.
Thanks in advance. simulink, stateflow, xml MATLAB Answers — New Questions
about the use of the fullfact function
I want use the function of fullfact in R2025b, but there is a note that :fullfact needs Statistics and Machine Learning Toolbox。
I installed fullfact Statistics and Machine Learning Toolbox by checking the Add-Ons, but when i check the installation with ver, there is no Statistics and Machine Learning Toolbox,I don’t know why, and how can i use the fullfact.I want use the function of fullfact in R2025b, but there is a note that :fullfact needs Statistics and Machine Learning Toolbox。
I installed fullfact Statistics and Machine Learning Toolbox by checking the Add-Ons, but when i check the installation with ver, there is no Statistics and Machine Learning Toolbox,I don’t know why, and how can i use the fullfact. I want use the function of fullfact in R2025b, but there is a note that :fullfact needs Statistics and Machine Learning Toolbox。
I installed fullfact Statistics and Machine Learning Toolbox by checking the Add-Ons, but when i check the installation with ver, there is no Statistics and Machine Learning Toolbox,I don’t know why, and how can i use the fullfact. fullfact, statistics and machine learning toolbox MATLAB Answers — New Questions
How to TX/RX using 2 boards with the “HW/SW Co-Design QPSK Transmit and Receive Using Analog Devices AD9361/AD9364” example
Hello,
I am trying to transmit and receive using 2 different supported boards (2x ZEDBOARD + 2x FMCOMMS3) using following example:
https://in.mathworks.com/help/soc/ug/hw-sw-co-design-qpsk-transmit-and-receive-using-analog-devices-ad9361-ad9364.html
I have succesfully compiled the simulation, programmed the board via HDL Coder and HDL Workflow Advisor and transmitted and received with ease using one board. However, when trying to use 2 boards, I do not know the procedure I need to follow for a successful TX/RX over air. I am not able to see the other board’s data at the receiver. I do not receive anything.
My approach was the following:
– I configured both ZEDBOARDs with the bitstream of the example.
– I attached one antenna to the TX port of the TX FMCOMMS3 and one antenna to the RX port of the RX FMCOMMS3.
– I disabled on one end the AD936x transmitter system and on the other the AD936x receiver system.
– The systems can be seen in the attached images.
– The UDP receive model was running on the receiver side.
The result: I do not see any bits coming into the RX side.
Anybody has some expertise in this? Maybe there are other examples which I have not discovered yet that address this scenario…
Any help would be welcome. Thank you in advance
—————————————————————————————-
RX Side:
TX side:
UDP Model:Hello,
I am trying to transmit and receive using 2 different supported boards (2x ZEDBOARD + 2x FMCOMMS3) using following example:
https://in.mathworks.com/help/soc/ug/hw-sw-co-design-qpsk-transmit-and-receive-using-analog-devices-ad9361-ad9364.html
I have succesfully compiled the simulation, programmed the board via HDL Coder and HDL Workflow Advisor and transmitted and received with ease using one board. However, when trying to use 2 boards, I do not know the procedure I need to follow for a successful TX/RX over air. I am not able to see the other board’s data at the receiver. I do not receive anything.
My approach was the following:
– I configured both ZEDBOARDs with the bitstream of the example.
– I attached one antenna to the TX port of the TX FMCOMMS3 and one antenna to the RX port of the RX FMCOMMS3.
– I disabled on one end the AD936x transmitter system and on the other the AD936x receiver system.
– The systems can be seen in the attached images.
– The UDP receive model was running on the receiver side.
The result: I do not see any bits coming into the RX side.
Anybody has some expertise in this? Maybe there are other examples which I have not discovered yet that address this scenario…
Any help would be welcome. Thank you in advance
—————————————————————————————-
RX Side:
TX side:
UDP Model: Hello,
I am trying to transmit and receive using 2 different supported boards (2x ZEDBOARD + 2x FMCOMMS3) using following example:
https://in.mathworks.com/help/soc/ug/hw-sw-co-design-qpsk-transmit-and-receive-using-analog-devices-ad9361-ad9364.html
I have succesfully compiled the simulation, programmed the board via HDL Coder and HDL Workflow Advisor and transmitted and received with ease using one board. However, when trying to use 2 boards, I do not know the procedure I need to follow for a successful TX/RX over air. I am not able to see the other board’s data at the receiver. I do not receive anything.
My approach was the following:
– I configured both ZEDBOARDs with the bitstream of the example.
– I attached one antenna to the TX port of the TX FMCOMMS3 and one antenna to the RX port of the RX FMCOMMS3.
– I disabled on one end the AD936x transmitter system and on the other the AD936x receiver system.
– The systems can be seen in the attached images.
– The UDP receive model was running on the receiver side.
The result: I do not see any bits coming into the RX side.
Anybody has some expertise in this? Maybe there are other examples which I have not discovered yet that address this scenario…
Any help would be welcome. Thank you in advance
—————————————————————————————-
RX Side:
TX side:
UDP Model: simulink, ad9361, zedboard, fmcomms3 MATLAB Answers — New Questions
Convert non inlined s-function to inlined with wrapper
Hello!
I’m trying to reproduce the model described in this article: https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147
I’ve created the non inlined model. This model take an array of numbers and multuply by 2 each element.
The core function is the flowing:
static void mdlOutputs(SimStruct *S, int_T tid)
{
InputPtrsType uPtrs = ssGetInputPortSignalPtrs(S, 0);
uint8_T *y = (uint8_T *)ssGetOutputPortSignal(S, 0);
int_T width = ssGetOutputPortWidth(S, 0);
for (int_T i = 0; i < width; i++) {
y[i] = 2 * (*(uint8_T *)uPtrs[i]);
}
}
I’ve make a simple model and compile the *.c file with command:
mex times_two.c
The model is in the Noninlined.zip
Now; with the help of the article (https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147) I’ve created a wrapsfcn.tlc:
%%This code is the TLC file wrapsfcn.tlc that inlines wrapsfcn.c:
%% File : wrapsfcn.tlc
%% Abstract:
%% Example inlined tlc file for S-function wrapsfcn.c
%%
%implements "wrapsfcn" "C"
%% Function: BlockTypeSetup ====================================================
%% Abstract:
%% Create function prototype in model.h as:
%% "extern real_T times_two(real_T u);"
%%
%function BlockTypeSetup(block, system) void
%openfile buffer
extern real_T times_two(real_T u); /* This line is placed in wrapper.h */
%closefile buffer
%<LibCacheFunctionPrototype(buffer)>
%endfunction %% BlockTypeSetup
%% Function: Outputs ===========================================================
%% Abstract:
%% y = times_two( u );
%%
%function Outputs(block, system) Output
/* %<Type> Block: %<Name> */
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
%% PROVIDE THE CALLING STATEMENT FOR "algorithm"
%% The following line is expanded and placed in mdlOutputs within wrapper.c
{
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
for (i = 0; i < %<LibBlockInputSignalWidth(0)>; i++) {
%<y> = times_two(%<u>);
}
}
%endfunction %% Outputs
and the file times_two.c:
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#endif
real_T times_two(real_T u)
{
return(2.0 * u);
}
I’ve made a model (see Inlined.zip) but the Simulink didn’t detect the function real_T times_two(real_T u)
Error in S-function ‘inlined_wrapsfcn/S-Function’: S-Function ‘wrapsfcn’ does not exist
From the article I don’t understand what should be the exact content of the files wrapper.c and wrapper.h. It may be the reason why the inlined model didn’t work.
Could you please explain me that steps I’ve missed?Hello!
I’m trying to reproduce the model described in this article: https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147
I’ve created the non inlined model. This model take an array of numbers and multuply by 2 each element.
The core function is the flowing:
static void mdlOutputs(SimStruct *S, int_T tid)
{
InputPtrsType uPtrs = ssGetInputPortSignalPtrs(S, 0);
uint8_T *y = (uint8_T *)ssGetOutputPortSignal(S, 0);
int_T width = ssGetOutputPortWidth(S, 0);
for (int_T i = 0; i < width; i++) {
y[i] = 2 * (*(uint8_T *)uPtrs[i]);
}
}
I’ve make a simple model and compile the *.c file with command:
mex times_two.c
The model is in the Noninlined.zip
Now; with the help of the article (https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147) I’ve created a wrapsfcn.tlc:
%%This code is the TLC file wrapsfcn.tlc that inlines wrapsfcn.c:
%% File : wrapsfcn.tlc
%% Abstract:
%% Example inlined tlc file for S-function wrapsfcn.c
%%
%implements "wrapsfcn" "C"
%% Function: BlockTypeSetup ====================================================
%% Abstract:
%% Create function prototype in model.h as:
%% "extern real_T times_two(real_T u);"
%%
%function BlockTypeSetup(block, system) void
%openfile buffer
extern real_T times_two(real_T u); /* This line is placed in wrapper.h */
%closefile buffer
%<LibCacheFunctionPrototype(buffer)>
%endfunction %% BlockTypeSetup
%% Function: Outputs ===========================================================
%% Abstract:
%% y = times_two( u );
%%
%function Outputs(block, system) Output
/* %<Type> Block: %<Name> */
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
%% PROVIDE THE CALLING STATEMENT FOR "algorithm"
%% The following line is expanded and placed in mdlOutputs within wrapper.c
{
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
for (i = 0; i < %<LibBlockInputSignalWidth(0)>; i++) {
%<y> = times_two(%<u>);
}
}
%endfunction %% Outputs
and the file times_two.c:
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#endif
real_T times_two(real_T u)
{
return(2.0 * u);
}
I’ve made a model (see Inlined.zip) but the Simulink didn’t detect the function real_T times_two(real_T u)
Error in S-function ‘inlined_wrapsfcn/S-Function’: S-Function ‘wrapsfcn’ does not exist
From the article I don’t understand what should be the exact content of the files wrapper.c and wrapper.h. It may be the reason why the inlined model didn’t work.
Could you please explain me that steps I’ve missed? Hello!
I’m trying to reproduce the model described in this article: https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147
I’ve created the non inlined model. This model take an array of numbers and multuply by 2 each element.
The core function is the flowing:
static void mdlOutputs(SimStruct *S, int_T tid)
{
InputPtrsType uPtrs = ssGetInputPortSignalPtrs(S, 0);
uint8_T *y = (uint8_T *)ssGetOutputPortSignal(S, 0);
int_T width = ssGetOutputPortWidth(S, 0);
for (int_T i = 0; i < width; i++) {
y[i] = 2 * (*(uint8_T *)uPtrs[i]);
}
}
I’ve make a simple model and compile the *.c file with command:
mex times_two.c
The model is in the Noninlined.zip
Now; with the help of the article (https://nl.mathworks.com/help/rtw/ug/write-wrapper-s-function-and-tlc-files.html#f53147) I’ve created a wrapsfcn.tlc:
%%This code is the TLC file wrapsfcn.tlc that inlines wrapsfcn.c:
%% File : wrapsfcn.tlc
%% Abstract:
%% Example inlined tlc file for S-function wrapsfcn.c
%%
%implements "wrapsfcn" "C"
%% Function: BlockTypeSetup ====================================================
%% Abstract:
%% Create function prototype in model.h as:
%% "extern real_T times_two(real_T u);"
%%
%function BlockTypeSetup(block, system) void
%openfile buffer
extern real_T times_two(real_T u); /* This line is placed in wrapper.h */
%closefile buffer
%<LibCacheFunctionPrototype(buffer)>
%endfunction %% BlockTypeSetup
%% Function: Outputs ===========================================================
%% Abstract:
%% y = times_two( u );
%%
%function Outputs(block, system) Output
/* %<Type> Block: %<Name> */
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
%% PROVIDE THE CALLING STATEMENT FOR "algorithm"
%% The following line is expanded and placed in mdlOutputs within wrapper.c
{
%assign u = LibBlockInputSignal( 0, "i", "", 0)
%assign y = LibBlockOutputSignal(0, "i", "", 0)
for (i = 0; i < %<LibBlockInputSignalWidth(0)>; i++) {
%<y> = times_two(%<u>);
}
}
%endfunction %% Outputs
and the file times_two.c:
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#endif
real_T times_two(real_T u)
{
return(2.0 * u);
}
I’ve made a model (see Inlined.zip) but the Simulink didn’t detect the function real_T times_two(real_T u)
Error in S-function ‘inlined_wrapsfcn/S-Function’: S-Function ‘wrapsfcn’ does not exist
From the article I don’t understand what should be the exact content of the files wrapper.c and wrapper.h. It may be the reason why the inlined model didn’t work.
Could you please explain me that steps I’ve missed? s-function, mex, tlc, wrapper, inline MATLAB Answers — New Questions
New Outlook Gets Smarter DLP
Custom Oversharing Dialog Works in the New Outlook Client
Given that message center notification MC1202974 (Microsoft 365 roadmap item 498921) appeared on 22 December 2025, I might have been forgiven for overlooking the announcement that the new Outlook for Windows client (aka Monarch) will support custom oversharing dialog for Data Loss Prevention (DLP) policies by the end of January 2026. But I have written about oversharing dialogs before, so it seemed like a good idea to examine how the custom variation works.
What an Oversharing Dialog Does
In a nutshell, an oversharing dialog is a pop-up invoked by an Outlook client when a DLP policy detects a potential rule violation in a message or its attachments. The idea is that the dialog gives the user the chance to amend the message before it is sent. A custom oversharing dialog contains information customized by the Microsoft 365 tenant. Figure 1 shows a custom oversharing dialog in Outlook (classic).

As you can see, the oversharing dialog gives the user the opportunity to override the block by providing a justification and acknowledging that the content meets organizational standards.
Outlook must have the opportunity to recognize that a violation is present, and it is possible that the oversharing dialog never appears if a user creates and sends a message quickly. You can configure a delay in sending to allow time for content evaluation against policies or let the message flow through to the transport pipeline. If the DLP evaluation in the transport pipeline detects a problem there, it will take whatever action is configured in the policy, such as blocking delivery of the message to external recipients.
Creating a Custom Oversharing Dialog
To implement a custom oversharing dialog, upload a JSON file to a policy rule after setting the “upload a JSON file containing custom content that will be used in the pop-up dialog” checkbox in the policy tips section of the rule configuration.
The JSON file contains the text for the custom directives in up to ten languages (a default language must be chosen). The text can include tokens for matched recipients, attachment file names, and sensitivity labels. The format and syntax of the JSON file is checked when the updated policy is submitted in the Purview portal.
Composing JSON can be a challenge if you’re not fluent in this subject. I usually start with the example file in the Microsoft documentation and make the necessary changes in Visual Studio Code (Figure 2).

A DLP rule can also be updated with the JSON to describe a custom oversharing dialog via PowerShell. To do this, put the content of the file in a variable and then use the Set-DlpComplianceRule cmdlet to update the rule. Before you can run the cmdlet, you’ll need to connect to the compliance endpoint after connecting to Exchange Online (run Connect-ExchangeOnline and then Connect-IPPSSession):
$JSONCustomContent = Get-Content "c:tempRule.JSON" -Encoding UTF8 | Out-String Set-DlpComplianceRule -Identity "Oversharing Rule 1" -NotifyPolicyTipCustomDialog $JSONCustomContent -NotifyPolicyTipDisplayOption Dialog
Validation of the JSON content occurs when PowerShell attempts to update the rule. For example, DLP checks that the custom title property for each language does not exceed the 75-character maximum.
Like other changes to DLP policies, it can take a few hours to synchronize the update within a tenant. Clients must then pick up the updated policies before the changes are fully active. Both Outlook (classic) and the new Outlook support the same custom oversharing dialogs.
Oversharing Dialog Works
The oversharing dialog for DLP policies is a good idea that works well. Tweaking the JSON to create the desired effect for the dialog can take a few attempts and the limitations imposed by Microsoft are a little restrictive. But all-in-all, oversharing dialogs are a feature that should be considered for any DLP email-focused policy.
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!
how to plot 3d surface maps? interpolation?
Hi All,
i am struggeling to have a correct interpolation (IDW) for 3d surface maps for the spatial analysis of the parameters collected by CTD to plot temperature (as an example). There is something wrong!
any help is very much appreciated
the steps are below:
1- list of mat fiels each of this mat files contains T table inside (screenshot shows).
2- download the mat fiels
3- grid the data from mulitple CTD locations
4- Surface maps with the coastlines
dataDir = ‘/’;
files = dir(fullfile(dataDir, ‘*.mat’));
T_all = table();
for i = 1:length(files)
fname = fullfile(dataDir, files(i).name);
S = load(fname);
if isfield(S,’T’)
Ti = S.T;
Ti.SourceFile = repmat(string(files(i).name), height(Ti), 1);
Tall = [Tall; Ti];
else
warning(‘%s does not contain table T’, files(i).name)
end
end
depth_target = 2.0; % meters
tol = 0.5; % ±0.5 m
Tz = Tall(abs(Tall.Depth_m – depth_target) <= tol, :);
[G, station, date] = findgroups(Tz.Station, Tz.Date);
Tmap = table();
Tmap.Station = station;
Tmap.Date = date;
Tmap.Lat = splitapply(@mean, Tz.Lat, G);
Tmap.Lon = splitapply(@mean, Tz.Lon, G);
Tmap.Temp = splitapply(@mean, Tz.Temp_C, G);
min_map_lon = 35.2;
max_map_lon = 37.2;
min_map_lat = 25.1;
max_map_lat = 27.6;
[LonGrid, LatGrid] = meshgrid( …
linspace(min_map_lon, max_map_lon, 250), …
linspace(min_map_lat, max_map_lat, 250));
TempGrid = griddata( …
Tmap.Lon, Tmap.Lat, Tmap.Temp, …
LonGrid, LatGrid, ‘v4’); % IDW
load RS_bathy_gebgo % longitude, latitude, bathy
orient portrait
figure
hold on
m_proj(‘mercator’, …
‘lon’,[min_map_lon max_map_lon], …
‘lat’,[min_map_lat max_map_lat]);
m_pcolor(longitude, latitude, bathy);
shading interp
colormap(flipud(gray))
caxis([-1200 0])
h = m_pcolor(LonGrid, LatGrid, TempGrid);
set(h,’FaceAlpha’,0.85) % transparency so bathy shows
shading interp
colormap(turbo)
m_usercoast(‘red_sea_f’,’patch’,[0.8 0.8 0.8])
m_grid(‘contour’,’on’,’tickdir’,’out’, …
‘box’,’fancy’,’fontsize’,10, …
‘linewidth’,1,’linestyle’,’–‘);
colorbar
ylabel(‘Latitude’,’fontsize’,16,’fontweight’,’bold’);
xlabel(‘Longitude’,’fontsize’,16,’fontweight’,’bold’);Hi All,
i am struggeling to have a correct interpolation (IDW) for 3d surface maps for the spatial analysis of the parameters collected by CTD to plot temperature (as an example). There is something wrong!
any help is very much appreciated
the steps are below:
1- list of mat fiels each of this mat files contains T table inside (screenshot shows).
2- download the mat fiels
3- grid the data from mulitple CTD locations
4- Surface maps with the coastlines
dataDir = ‘/’;
files = dir(fullfile(dataDir, ‘*.mat’));
T_all = table();
for i = 1:length(files)
fname = fullfile(dataDir, files(i).name);
S = load(fname);
if isfield(S,’T’)
Ti = S.T;
Ti.SourceFile = repmat(string(files(i).name), height(Ti), 1);
Tall = [Tall; Ti];
else
warning(‘%s does not contain table T’, files(i).name)
end
end
depth_target = 2.0; % meters
tol = 0.5; % ±0.5 m
Tz = Tall(abs(Tall.Depth_m – depth_target) <= tol, :);
[G, station, date] = findgroups(Tz.Station, Tz.Date);
Tmap = table();
Tmap.Station = station;
Tmap.Date = date;
Tmap.Lat = splitapply(@mean, Tz.Lat, G);
Tmap.Lon = splitapply(@mean, Tz.Lon, G);
Tmap.Temp = splitapply(@mean, Tz.Temp_C, G);
min_map_lon = 35.2;
max_map_lon = 37.2;
min_map_lat = 25.1;
max_map_lat = 27.6;
[LonGrid, LatGrid] = meshgrid( …
linspace(min_map_lon, max_map_lon, 250), …
linspace(min_map_lat, max_map_lat, 250));
TempGrid = griddata( …
Tmap.Lon, Tmap.Lat, Tmap.Temp, …
LonGrid, LatGrid, ‘v4’); % IDW
load RS_bathy_gebgo % longitude, latitude, bathy
orient portrait
figure
hold on
m_proj(‘mercator’, …
‘lon’,[min_map_lon max_map_lon], …
‘lat’,[min_map_lat max_map_lat]);
m_pcolor(longitude, latitude, bathy);
shading interp
colormap(flipud(gray))
caxis([-1200 0])
h = m_pcolor(LonGrid, LatGrid, TempGrid);
set(h,’FaceAlpha’,0.85) % transparency so bathy shows
shading interp
colormap(turbo)
m_usercoast(‘red_sea_f’,’patch’,[0.8 0.8 0.8])
m_grid(‘contour’,’on’,’tickdir’,’out’, …
‘box’,’fancy’,’fontsize’,10, …
‘linewidth’,1,’linestyle’,’–‘);
colorbar
ylabel(‘Latitude’,’fontsize’,16,’fontweight’,’bold’);
xlabel(‘Longitude’,’fontsize’,16,’fontweight’,’bold’); Hi All,
i am struggeling to have a correct interpolation (IDW) for 3d surface maps for the spatial analysis of the parameters collected by CTD to plot temperature (as an example). There is something wrong!
any help is very much appreciated
the steps are below:
1- list of mat fiels each of this mat files contains T table inside (screenshot shows).
2- download the mat fiels
3- grid the data from mulitple CTD locations
4- Surface maps with the coastlines
dataDir = ‘/’;
files = dir(fullfile(dataDir, ‘*.mat’));
T_all = table();
for i = 1:length(files)
fname = fullfile(dataDir, files(i).name);
S = load(fname);
if isfield(S,’T’)
Ti = S.T;
Ti.SourceFile = repmat(string(files(i).name), height(Ti), 1);
Tall = [Tall; Ti];
else
warning(‘%s does not contain table T’, files(i).name)
end
end
depth_target = 2.0; % meters
tol = 0.5; % ±0.5 m
Tz = Tall(abs(Tall.Depth_m – depth_target) <= tol, :);
[G, station, date] = findgroups(Tz.Station, Tz.Date);
Tmap = table();
Tmap.Station = station;
Tmap.Date = date;
Tmap.Lat = splitapply(@mean, Tz.Lat, G);
Tmap.Lon = splitapply(@mean, Tz.Lon, G);
Tmap.Temp = splitapply(@mean, Tz.Temp_C, G);
min_map_lon = 35.2;
max_map_lon = 37.2;
min_map_lat = 25.1;
max_map_lat = 27.6;
[LonGrid, LatGrid] = meshgrid( …
linspace(min_map_lon, max_map_lon, 250), …
linspace(min_map_lat, max_map_lat, 250));
TempGrid = griddata( …
Tmap.Lon, Tmap.Lat, Tmap.Temp, …
LonGrid, LatGrid, ‘v4’); % IDW
load RS_bathy_gebgo % longitude, latitude, bathy
orient portrait
figure
hold on
m_proj(‘mercator’, …
‘lon’,[min_map_lon max_map_lon], …
‘lat’,[min_map_lat max_map_lat]);
m_pcolor(longitude, latitude, bathy);
shading interp
colormap(flipud(gray))
caxis([-1200 0])
h = m_pcolor(LonGrid, LatGrid, TempGrid);
set(h,’FaceAlpha’,0.85) % transparency so bathy shows
shading interp
colormap(turbo)
m_usercoast(‘red_sea_f’,’patch’,[0.8 0.8 0.8])
m_grid(‘contour’,’on’,’tickdir’,’out’, …
‘box’,’fancy’,’fontsize’,10, …
‘linewidth’,1,’linestyle’,’–‘);
colorbar
ylabel(‘Latitude’,’fontsize’,16,’fontweight’,’bold’);
xlabel(‘Longitude’,’fontsize’,16,’fontweight’,’bold’); interpolation, 3d plots, surface MATLAB Answers — New Questions
Writecell/table to Excel error
Hi all,
I can no longer export data to Excel using writecell/table, because the function crashes due to an import issue :
Error using writetable (line 278)
Error: File: createWorkbook.m Line: 80 Column: 12
Unable to find or import ‘matlab.io.spreadsheet.internal.BookType’.Imported names must end with ‘.*’ or be fully qualified.
No problem in Matlab R2023, as it does not seem to use the same sub-functions.
Regards,
Stéphane.Hi all,
I can no longer export data to Excel using writecell/table, because the function crashes due to an import issue :
Error using writetable (line 278)
Error: File: createWorkbook.m Line: 80 Column: 12
Unable to find or import ‘matlab.io.spreadsheet.internal.BookType’.Imported names must end with ‘.*’ or be fully qualified.
No problem in Matlab R2023, as it does not seem to use the same sub-functions.
Regards,
Stéphane. Hi all,
I can no longer export data to Excel using writecell/table, because the function crashes due to an import issue :
Error using writetable (line 278)
Error: File: createWorkbook.m Line: 80 Column: 12
Unable to find or import ‘matlab.io.spreadsheet.internal.BookType’.Imported names must end with ‘.*’ or be fully qualified.
No problem in Matlab R2023, as it does not seem to use the same sub-functions.
Regards,
Stéphane. booktype, writecell, writetable MATLAB Answers — New Questions
How to hide the view selection cube
How can I hide the view selection cube in multibody explorer during a simulation?
Also the Orientation Triad.How can I hide the view selection cube in multibody explorer during a simulation?
Also the Orientation Triad. How can I hide the view selection cube in multibody explorer during a simulation?
Also the Orientation Triad. multibody explorer, view selection cube MATLAB Answers — New Questions
How to connect a PID signal to a H-bridge driver
Hello, a very simple question, but how do you connect a PID to the input of a H-bridge driver? I have read the relevant documentation on the H-bridge driver and tried using a simulink-PS converter however, none of these work, please could someone show me how to do this. Thanks.Hello, a very simple question, but how do you connect a PID to the input of a H-bridge driver? I have read the relevant documentation on the H-bridge driver and tried using a simulink-PS converter however, none of these work, please could someone show me how to do this. Thanks. Hello, a very simple question, but how do you connect a PID to the input of a H-bridge driver? I have read the relevant documentation on the H-bridge driver and tried using a simulink-PS converter however, none of these work, please could someone show me how to do this. Thanks. simscape, simulink, pid MATLAB Answers — New Questions
Deactivating an Entra ID Application
Deactivate Applications to Halt Access to Resources
Microsoft Entra ID documentation includes a page titled “Deactivate an enterprise application,” which explains that deactivating an application stops it being used because Entra ID will not issue access tokens to the application while it is deactivated, meaning that users cannot sign into the application and the application cannot be used to access protected resources (data) using its assigned permissions. Existing access tokens issued by Entra ID to the application continue to be valid until they expire (usually within an hour). The big plus point is that unlike the more radical deletion option, deactivation keeps application properties, roles, and permissions in place in a state that is easily reactivated to put the application back into use.
Applications are activated by default. Only an administrator or application owner can deactivate an application. If they’re signed into a Microsoft Graph PowerShell SDK interactive session, the delegated Application.ReadWrite.All permission must be available.
Microsoft says that deactivation is useful for security investigations, perhaps when a suspicious or unknown application is discovered during a periodic review of the app inventory or after a review of service principal sign-in activity. In these circumstances, it’s good to temporarily deactivate the application while everything is checked out.
Enterprise Applications and App Registrations
Microsoft’s use of the term “enterprise application” is loose and a tad misleading. Many enterprise applications, such as the first-party applications used by Microsoft 365 and the Microsoft Graph, or the Microsoft Graph PowerShell Tools application used for Microsoft Graph PowerShell SDK interactive sessions cannot be deactivated for a very simple reason: the ownership of these applications is tied to the Microsoft tenant, not yours. Deactivation is only possible if done in the tenant that owns an application.
In practical terms, this means that you can deactivate applications created in your tenant (often called app registrations), including applications designed for multi-tenant use because you have write access to those applications.
The isDisabled Property
The key to deactivate applications is to set the isDisabled property for applications to true. Today, this must be done through PowerShell because the Entra admin center doesn’t currently have an option to deactivate an application. Access to the isDisabled property is only available through the beta version of the Graph application endpoint.
When deactivating an application, I recommend that you update the application display name and notes to make sure that other administrators know about the application’s new status. This code creates a hash table containing the body for the Graph request and posts the request using the Update-MgApplication cmdlet:
# Create the request body
$NewDisplayName = $ApplicationObject.displayName + " (disabled)"
$NewNotes = ($ApplicationObject.notes.trim()) + "`nApp disabled on " + (Get-Date -format "dd-MMM-yyyy HH:mm") + " by " + (Get-MgContext).account
$RequestBody = @{}
$RequestBody.Add("isDisabled", $true)
$RequestBody.Add("displayName", $NewDisplayName)
$RequestBody.Add("notes", $NewNotes)
# Update the application
Update-MgApplication -ApplicationId $ApplicationObject.Id -BodyParameter $RequestBody
Assuming a successful request, the Entra admin center highlights the application’s deactivated status (Figure 1).

Attempts to sign into the deactivated application generate AADSTS7000112 (“application is disabled”) errors.
Reactivating an application is easily done by adjusting the content of the request body to reset the isDisabled property. This code also adjusts the display name and updates the application notes to record the reactivation:
$NewDisplayName = $ApplicationObject.displayName.split("(")[0]
$NewNotes = ($ApplicationObject.notes.trim()) + "`nApp reactivated on " + (Get-Date -format "dd-MMM-yyyy HH:mm") + " by " + (Get-MgContext).account
$RequestBody = @{}
$RequestBody.Add("isDisabled", $false)
$RequestBody.Add("displayName", $NewDisplayName)
$RequestBody.Add("notes", $NewNotes)
Update-MgApplication -ApplicationId $ApplicationObject.Id -BodyParameter $RequestBody
Remove App Owners
The documentation suggests that you remove application owners before deactivation to make sure that only administrators can reactivate the application. This advice is contrary to the assertion that deactivation is good because it preserves application data. However, let’s not argue and go ahead with some code to remove application owners (if present):
# Remove application owners
[array]$Owners = Get-MgApplicationOwner -ApplicationId $ApplicationObject.Id -All
ForEach ($Owner in $Owners) {
Try {
Remove-MgApplicationOwnerDirectoryObjectByRef -ApplicationId $ApplicationObject.Id -DirectoryObjectId $Owner.Id
Write-Host ("Removed owner {0} from application..." -f $Owner.DisplayName)
} Catch {
Write-Host ("Failed to remove owner {0} from application. Error details:" -f $Owner.DisplayName)
Write-Host $_.Exception.Message
}
}
Remember to add the application owners back when you reactivate the application.
You can download a working script containing the code described above and other steps (like error checking) from the Office 365 for IT Pros GitHub repository.
Deactivate Applications is a Step Toward Full Application Lifecycle
Application deactivation is now the go-to method to put an application into an inactive state. It’s another small but welcome step along the path to full lifecycle management for Entra ID applications.
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 display square root symbol instead of decimal.
The number of display format does not include the square, I can only select decimal, rational…, but not square root. When I input sqrt(5) in a matrix and display it, it is transformed to decimal. Can I keep the square root form?The number of display format does not include the square, I can only select decimal, rational…, but not square root. When I input sqrt(5) in a matrix and display it, it is transformed to decimal. Can I keep the square root form? The number of display format does not include the square, I can only select decimal, rational…, but not square root. When I input sqrt(5) in a matrix and display it, it is transformed to decimal. Can I keep the square root form? number display format MATLAB Answers — New Questions
How would i get acces to a object that i only know the name of?
I have this custom component that i want to make for the app designer, the issue is that i am unable to send the object in question to the custom component on creation as that isnt allowed.
This code snippet was something i tried but didnt work as its not allowed to have custom components with input parameters.
function obj = Movcomp(Scenemanager)
addlisterner(Scenemanager,’Delete’,@Movcomp.Delete)
end
i would still like to do something like this As the Scenemanager will be one or multilple objects that will create and delete different components using callbacks. I couldnt find a way to create global callbacks similair to what can be done using a singleton for signals in godotI have this custom component that i want to make for the app designer, the issue is that i am unable to send the object in question to the custom component on creation as that isnt allowed.
This code snippet was something i tried but didnt work as its not allowed to have custom components with input parameters.
function obj = Movcomp(Scenemanager)
addlisterner(Scenemanager,’Delete’,@Movcomp.Delete)
end
i would still like to do something like this As the Scenemanager will be one or multilple objects that will create and delete different components using callbacks. I couldnt find a way to create global callbacks similair to what can be done using a singleton for signals in godot I have this custom component that i want to make for the app designer, the issue is that i am unable to send the object in question to the custom component on creation as that isnt allowed.
This code snippet was something i tried but didnt work as its not allowed to have custom components with input parameters.
function obj = Movcomp(Scenemanager)
addlisterner(Scenemanager,’Delete’,@Movcomp.Delete)
end
i would still like to do something like this As the Scenemanager will be one or multilple objects that will create and delete different components using callbacks. I couldnt find a way to create global callbacks similair to what can be done using a singleton for signals in godot appdesigner MATLAB Answers — New Questions
Trying to read a text field from my Thingspeak channel (text) and display it using arduino giga display shield.
Matlab Visualization Code (works properly)
My first 3 lines of information display properly on my giga display shield.
The 4th line which is supposed to be a timestamp stored in my field as text (ex:
Displays as -1, not the text timestamp I am looking for. Any help is appreciated.
% Read the last entry and its timestamp
[data, timestamps] = thingSpeakRead(x, ‘NumPoints’, 1);
% Add a timezone offset of 5 hours
localTime = timestamps – hours(5);
% Display the local timestamp as text
text(0.5, 0.5, datestr(localTime), ‘FontSize’, 20, ‘HorizontalAlignment’, ‘center’);
axis off;
Note – sensitive info replaced with X
Arduino code
#include <WiFi.h> //library for connecting to WiFi
#include <ThingSpeak.h> //library for reading data from ThingSpeak
#include "Arduino_GigaDisplay_GFX.h" //library for using the GigaDisplay shield
//define WiFi credentials
const char* ssid = "x";
const char* password = "x";
WiFiClient client;
String textData = "";
//define ThingSpeak channel IDs and read APIs
unsigned long lakeChannelID = x;
const char* lakeReadAPI = "x";
//define GigaDisplay object
GigaDisplay_GFX display;
#define BLACK 0x0000
#define WHITE 0xFFFF
#define NEW 0xFF6B35
void setup() {
//initialize serial communication for debugging
Serial.begin(9600);
//connect to WiFi
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi…");
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println("Connected!");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
ThingSpeak.begin(client); // Initialize ThingSpeak
display.begin();
}
void loop() {
float homeTemp = ThingSpeak.readFloatField(lakeChannelID, 8, lakeReadAPI);
float lakeTemp1 = ThingSpeak.readFloatField(lakeChannelID, 1, lakeReadAPI);
float lakeTemp2 = ThingSpeak.readFloatField(lakeChannelID, 2, lakeReadAPI);
float lakeTemp3 = ThingSpeak.readFloatField(lakeChannelID, 3, lakeReadAPI);
float lakeTemp4 = ThingSpeak.readFloatField(lakeChannelID, 4, lakeReadAPI);
float lakeTemp5 = ThingSpeak.readFloatField(lakeChannelID, 5, lakeReadAPI);
float lakeTemp6 = ThingSpeak.readFloatField(lakeChannelID, 6, lakeReadAPI);
String textData = ThingSpeak.readStringField(lakeChannelID,7, lakeReadAPI);
float lakeTempOutAvg = (lakeTemp1 + lakeTemp2 + lakeTemp3)/3;
float lakeTempUnderAvg = (lakeTemp4 + lakeTemp5 + lakeTemp6)/3;
long statuscode = ThingSpeak.getLastReadStatus();
if (statuscode == 200)
{
//print temperature data to serial monitor for debugging
Serial.print("Home Outside Temp: ");
Serial.println(homeTemp);
Serial.print("Lake Outside Temp: ");
Serial.println(lakeTemp1);
Serial.print("Lake Outside Average: ");
Serial.println(lakeTempOutAvg);
Serial.print("Lake Under Average: ");
Serial.println(lakeTempUnderAvg);
Serial.print("Last Read: ");
Serial.println(textData);
//clear display and set cursor to top left corner
display.setRotation(1); // -90 degrees rotation
display.fillScreen(BLACK);
display.setTextColor(NEW);
display.setTextSize( 5);
display.setCursor(50, 10); // Adjusted for rotated display
display.print("Home Outdoors");
display.setCursor(200, 60); // Adjusted for rotated display
display.print(homeTemp, 1);
display.print(" F");
display.setCursor(50, 120); // Adjusted for rotated display
display.print("Lake Outdoors");
display.setCursor(200, 170); // Adjusted for rotated display
display.print(lakeTempOutAvg, 1);
display.print(" F");
display.setCursor(50, 230); // Adjusted for rotated display
display.print("Lake Under House");
display.setCursor(200, 280); // Adjusted for rotated display
display.print(lakeTempUnderAvg, 1);
display.print(" F");
display.setCursor(50, 340); // Adjusted for rotated display
display.print("Data Last Reported");
display.setCursor(200, 390); // Adjusted for rotated display
display.print(textData);
//wait for 10 seconds before updating again
delay(10000);
}
}
//Code sourced from ThingSpeak and GigaDisplay libraries.Matlab Visualization Code (works properly)
My first 3 lines of information display properly on my giga display shield.
The 4th line which is supposed to be a timestamp stored in my field as text (ex:
Displays as -1, not the text timestamp I am looking for. Any help is appreciated.
% Read the last entry and its timestamp
[data, timestamps] = thingSpeakRead(x, ‘NumPoints’, 1);
% Add a timezone offset of 5 hours
localTime = timestamps – hours(5);
% Display the local timestamp as text
text(0.5, 0.5, datestr(localTime), ‘FontSize’, 20, ‘HorizontalAlignment’, ‘center’);
axis off;
Note – sensitive info replaced with X
Arduino code
#include <WiFi.h> //library for connecting to WiFi
#include <ThingSpeak.h> //library for reading data from ThingSpeak
#include "Arduino_GigaDisplay_GFX.h" //library for using the GigaDisplay shield
//define WiFi credentials
const char* ssid = "x";
const char* password = "x";
WiFiClient client;
String textData = "";
//define ThingSpeak channel IDs and read APIs
unsigned long lakeChannelID = x;
const char* lakeReadAPI = "x";
//define GigaDisplay object
GigaDisplay_GFX display;
#define BLACK 0x0000
#define WHITE 0xFFFF
#define NEW 0xFF6B35
void setup() {
//initialize serial communication for debugging
Serial.begin(9600);
//connect to WiFi
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi…");
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println("Connected!");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
ThingSpeak.begin(client); // Initialize ThingSpeak
display.begin();
}
void loop() {
float homeTemp = ThingSpeak.readFloatField(lakeChannelID, 8, lakeReadAPI);
float lakeTemp1 = ThingSpeak.readFloatField(lakeChannelID, 1, lakeReadAPI);
float lakeTemp2 = ThingSpeak.readFloatField(lakeChannelID, 2, lakeReadAPI);
float lakeTemp3 = ThingSpeak.readFloatField(lakeChannelID, 3, lakeReadAPI);
float lakeTemp4 = ThingSpeak.readFloatField(lakeChannelID, 4, lakeReadAPI);
float lakeTemp5 = ThingSpeak.readFloatField(lakeChannelID, 5, lakeReadAPI);
float lakeTemp6 = ThingSpeak.readFloatField(lakeChannelID, 6, lakeReadAPI);
String textData = ThingSpeak.readStringField(lakeChannelID,7, lakeReadAPI);
float lakeTempOutAvg = (lakeTemp1 + lakeTemp2 + lakeTemp3)/3;
float lakeTempUnderAvg = (lakeTemp4 + lakeTemp5 + lakeTemp6)/3;
long statuscode = ThingSpeak.getLastReadStatus();
if (statuscode == 200)
{
//print temperature data to serial monitor for debugging
Serial.print("Home Outside Temp: ");
Serial.println(homeTemp);
Serial.print("Lake Outside Temp: ");
Serial.println(lakeTemp1);
Serial.print("Lake Outside Average: ");
Serial.println(lakeTempOutAvg);
Serial.print("Lake Under Average: ");
Serial.println(lakeTempUnderAvg);
Serial.print("Last Read: ");
Serial.println(textData);
//clear display and set cursor to top left corner
display.setRotation(1); // -90 degrees rotation
display.fillScreen(BLACK);
display.setTextColor(NEW);
display.setTextSize( 5);
display.setCursor(50, 10); // Adjusted for rotated display
display.print("Home Outdoors");
display.setCursor(200, 60); // Adjusted for rotated display
display.print(homeTemp, 1);
display.print(" F");
display.setCursor(50, 120); // Adjusted for rotated display
display.print("Lake Outdoors");
display.setCursor(200, 170); // Adjusted for rotated display
display.print(lakeTempOutAvg, 1);
display.print(" F");
display.setCursor(50, 230); // Adjusted for rotated display
display.print("Lake Under House");
display.setCursor(200, 280); // Adjusted for rotated display
display.print(lakeTempUnderAvg, 1);
display.print(" F");
display.setCursor(50, 340); // Adjusted for rotated display
display.print("Data Last Reported");
display.setCursor(200, 390); // Adjusted for rotated display
display.print(textData);
//wait for 10 seconds before updating again
delay(10000);
}
}
//Code sourced from ThingSpeak and GigaDisplay libraries. Matlab Visualization Code (works properly)
My first 3 lines of information display properly on my giga display shield.
The 4th line which is supposed to be a timestamp stored in my field as text (ex:
Displays as -1, not the text timestamp I am looking for. Any help is appreciated.
% Read the last entry and its timestamp
[data, timestamps] = thingSpeakRead(x, ‘NumPoints’, 1);
% Add a timezone offset of 5 hours
localTime = timestamps – hours(5);
% Display the local timestamp as text
text(0.5, 0.5, datestr(localTime), ‘FontSize’, 20, ‘HorizontalAlignment’, ‘center’);
axis off;
Note – sensitive info replaced with X
Arduino code
#include <WiFi.h> //library for connecting to WiFi
#include <ThingSpeak.h> //library for reading data from ThingSpeak
#include "Arduino_GigaDisplay_GFX.h" //library for using the GigaDisplay shield
//define WiFi credentials
const char* ssid = "x";
const char* password = "x";
WiFiClient client;
String textData = "";
//define ThingSpeak channel IDs and read APIs
unsigned long lakeChannelID = x;
const char* lakeReadAPI = "x";
//define GigaDisplay object
GigaDisplay_GFX display;
#define BLACK 0x0000
#define WHITE 0xFFFF
#define NEW 0xFF6B35
void setup() {
//initialize serial communication for debugging
Serial.begin(9600);
//connect to WiFi
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi…");
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println("Connected!");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
ThingSpeak.begin(client); // Initialize ThingSpeak
display.begin();
}
void loop() {
float homeTemp = ThingSpeak.readFloatField(lakeChannelID, 8, lakeReadAPI);
float lakeTemp1 = ThingSpeak.readFloatField(lakeChannelID, 1, lakeReadAPI);
float lakeTemp2 = ThingSpeak.readFloatField(lakeChannelID, 2, lakeReadAPI);
float lakeTemp3 = ThingSpeak.readFloatField(lakeChannelID, 3, lakeReadAPI);
float lakeTemp4 = ThingSpeak.readFloatField(lakeChannelID, 4, lakeReadAPI);
float lakeTemp5 = ThingSpeak.readFloatField(lakeChannelID, 5, lakeReadAPI);
float lakeTemp6 = ThingSpeak.readFloatField(lakeChannelID, 6, lakeReadAPI);
String textData = ThingSpeak.readStringField(lakeChannelID,7, lakeReadAPI);
float lakeTempOutAvg = (lakeTemp1 + lakeTemp2 + lakeTemp3)/3;
float lakeTempUnderAvg = (lakeTemp4 + lakeTemp5 + lakeTemp6)/3;
long statuscode = ThingSpeak.getLastReadStatus();
if (statuscode == 200)
{
//print temperature data to serial monitor for debugging
Serial.print("Home Outside Temp: ");
Serial.println(homeTemp);
Serial.print("Lake Outside Temp: ");
Serial.println(lakeTemp1);
Serial.print("Lake Outside Average: ");
Serial.println(lakeTempOutAvg);
Serial.print("Lake Under Average: ");
Serial.println(lakeTempUnderAvg);
Serial.print("Last Read: ");
Serial.println(textData);
//clear display and set cursor to top left corner
display.setRotation(1); // -90 degrees rotation
display.fillScreen(BLACK);
display.setTextColor(NEW);
display.setTextSize( 5);
display.setCursor(50, 10); // Adjusted for rotated display
display.print("Home Outdoors");
display.setCursor(200, 60); // Adjusted for rotated display
display.print(homeTemp, 1);
display.print(" F");
display.setCursor(50, 120); // Adjusted for rotated display
display.print("Lake Outdoors");
display.setCursor(200, 170); // Adjusted for rotated display
display.print(lakeTempOutAvg, 1);
display.print(" F");
display.setCursor(50, 230); // Adjusted for rotated display
display.print("Lake Under House");
display.setCursor(200, 280); // Adjusted for rotated display
display.print(lakeTempUnderAvg, 1);
display.print(" F");
display.setCursor(50, 340); // Adjusted for rotated display
display.print("Data Last Reported");
display.setCursor(200, 390); // Adjusted for rotated display
display.print(textData);
//wait for 10 seconds before updating again
delay(10000);
}
}
//Code sourced from ThingSpeak and GigaDisplay libraries. thingspeak, arduino MATLAB Answers — New Questions
Why Doesn’t pwelch with the ‘centered’ Option Follow the Same Convention as fftshift for Even nfft?
When the fft length is even, fftshift flips the input so that the Nyquist point is to the left. But pwelch with freqrange = ‘centered’ keeps the Nyquist point on the right.
The behavior in pwelch is documented, so can’t complain.
Just wondering why the developers might have made that choice for pwelch (and others, like periodogram), rather than maintaining consistency.
rng(100);
x = rand(1,10);
X = fftshift(fft(x));
% this usage of pwelch is undocumented because noverlap is supposed to be
% a positive integer
[P,f] = pwelch(x,ones(size(x)),0,10,1,’centered’);
figure
plot(f,P*10,’-o’,(-5:4)/10,X.*conj(X),’-x’)
axis paddedWhen the fft length is even, fftshift flips the input so that the Nyquist point is to the left. But pwelch with freqrange = ‘centered’ keeps the Nyquist point on the right.
The behavior in pwelch is documented, so can’t complain.
Just wondering why the developers might have made that choice for pwelch (and others, like periodogram), rather than maintaining consistency.
rng(100);
x = rand(1,10);
X = fftshift(fft(x));
% this usage of pwelch is undocumented because noverlap is supposed to be
% a positive integer
[P,f] = pwelch(x,ones(size(x)),0,10,1,’centered’);
figure
plot(f,P*10,’-o’,(-5:4)/10,X.*conj(X),’-x’)
axis padded When the fft length is even, fftshift flips the input so that the Nyquist point is to the left. But pwelch with freqrange = ‘centered’ keeps the Nyquist point on the right.
The behavior in pwelch is documented, so can’t complain.
Just wondering why the developers might have made that choice for pwelch (and others, like periodogram), rather than maintaining consistency.
rng(100);
x = rand(1,10);
X = fftshift(fft(x));
% this usage of pwelch is undocumented because noverlap is supposed to be
% a positive integer
[P,f] = pwelch(x,ones(size(x)),0,10,1,’centered’);
figure
plot(f,P*10,’-o’,(-5:4)/10,X.*conj(X),’-x’)
axis padded pwelch, fftshift, centered MATLAB Answers — New Questions









