Category: News
How to run a MATLAB file without opening the MATLAB GUI?
Hello,
I am trying to test a batch file that runs matlab with an input file
the batch file is one line:
"C:Program FilesMATLABR2024bbinmatlab.exe" -noFigureWindows -minimize -nosplash -r "c:tmptesttest_matlab_no_GUI_batch.m"
the MATLAB file is:
a=6;
b=7;
c=a+b;
dlmwrite(‘c:tmptestHFSS_Batchtest_matlab_no_gui.txt’,c)
I would expect to see the "test_matlab_no_gui.txt" file in "c:tmptest" folder.
I am not. what am I missing?
Thank youHello,
I am trying to test a batch file that runs matlab with an input file
the batch file is one line:
"C:Program FilesMATLABR2024bbinmatlab.exe" -noFigureWindows -minimize -nosplash -r "c:tmptesttest_matlab_no_GUI_batch.m"
the MATLAB file is:
a=6;
b=7;
c=a+b;
dlmwrite(‘c:tmptestHFSS_Batchtest_matlab_no_gui.txt’,c)
I would expect to see the "test_matlab_no_gui.txt" file in "c:tmptest" folder.
I am not. what am I missing?
Thank you Hello,
I am trying to test a batch file that runs matlab with an input file
the batch file is one line:
"C:Program FilesMATLABR2024bbinmatlab.exe" -noFigureWindows -minimize -nosplash -r "c:tmptesttest_matlab_no_GUI_batch.m"
the MATLAB file is:
a=6;
b=7;
c=a+b;
dlmwrite(‘c:tmptestHFSS_Batchtest_matlab_no_gui.txt’,c)
I would expect to see the "test_matlab_no_gui.txt" file in "c:tmptest" folder.
I am not. what am I missing?
Thank you gui, matlab gui, batch MATLAB Answers — New Questions
Using fft and ifft with less frequencies than input points
I want to use fft and ifft in the context of heat equation. Therefore the grid needs to be refined, but I dont want to use as many coefficients in the fft:
%Grid
Nx = 10001;
dx = L/(Nx-1);
x = linspace(0,L,Nx)’;
%Function
f = @(x) rectangularPulse(0.5, 1.5, x);
f_values = arrayfun(f,x);
u0 = ifft(fft(f_values)); %Takes very long
What I would want to do, is to insert an N, f.e. N=100, but get an array 10001×1.
Thanks.I want to use fft and ifft in the context of heat equation. Therefore the grid needs to be refined, but I dont want to use as many coefficients in the fft:
%Grid
Nx = 10001;
dx = L/(Nx-1);
x = linspace(0,L,Nx)’;
%Function
f = @(x) rectangularPulse(0.5, 1.5, x);
f_values = arrayfun(f,x);
u0 = ifft(fft(f_values)); %Takes very long
What I would want to do, is to insert an N, f.e. N=100, but get an array 10001×1.
Thanks. I want to use fft and ifft in the context of heat equation. Therefore the grid needs to be refined, but I dont want to use as many coefficients in the fft:
%Grid
Nx = 10001;
dx = L/(Nx-1);
x = linspace(0,L,Nx)’;
%Function
f = @(x) rectangularPulse(0.5, 1.5, x);
f_values = arrayfun(f,x);
u0 = ifft(fft(f_values)); %Takes very long
What I would want to do, is to insert an N, f.e. N=100, but get an array 10001×1.
Thanks. fft, ode MATLAB Answers — New Questions
how to plot a certain level in a contour?
I ‘m using contour option in Matlab R2014a to plot many curves: contour(x,y,c,cilevels); with cilevels = [0.0,.005,0.019];
but I need to select one curve (level) from the contour: the option peaks is not working? and I have tried : contour(x,y,c,[1 1]); but it was error also?
could you please help me?I ‘m using contour option in Matlab R2014a to plot many curves: contour(x,y,c,cilevels); with cilevels = [0.0,.005,0.019];
but I need to select one curve (level) from the contour: the option peaks is not working? and I have tried : contour(x,y,c,[1 1]); but it was error also?
could you please help me? I ‘m using contour option in Matlab R2014a to plot many curves: contour(x,y,c,cilevels); with cilevels = [0.0,.005,0.019];
but I need to select one curve (level) from the contour: the option peaks is not working? and I have tried : contour(x,y,c,[1 1]); but it was error also?
could you please help me? contour, single level MATLAB Answers — New Questions
SharePoint Online Adds Support for Sensitivity Labels with User Defined Permissions
Opens Access to UDP-Protected Files to Search, eDiscovery, and DLP – but not Copilot
Originally announced in preview in an August 1, 2023 technical community post, message center notification MC1013467 (21 February 2025) contains the good news that SharePoint Online will deploy support for sensitivity labels with user-defined permissions (UDP) in mid-March 2025. The reason why this development is important is that SharePoint Online support for UDP enables support for these files in content searches, Purview eDiscovery, and Purview Data Loss Prevention (DLP).
Configuring Permissions for Sensitivity Labels
Most sensitivity labels that protect files with rights-management based encryption use permissions configured by administrators. Permissions are formed by a set of usage rights that dictate what level of access an authenticated user has to a file. The same permissions apply to all files that receive a label with preconfigured access.
User-defined permissions allow file owners to assign different permissions for different files. To allow this to happen, administrators must configure a sensitivity label to support UDP (Figure 1).

After the label is published to make it available to users, they can assign the label and configure permissions for files (Figure 2). UDP labels are visible in Office web applications but can only be set by Office desktop applications.

Clicking more options reveals additional controls for a user to assign to protect a file, including an expiration date (which doesn’t pick up the date format configured for the workstation) for the permissions, a contact email address to request additional permissions, and whether a user must be online to validate their permission before they can open a file. The last option, to access content programmatically, allows Word and Excel to run code within a protected document.

Support for Microsoft Search
The initial SharePoint support for UDP-protected files previewed in August 2023 was limited. The big issue remained that files with UDP labels stored in SharePoint Online or OneDrive for Business couldn’t be indexed by Microsoft Search because Search had no way to gain access to file content (metadata for UDP-protected files is always indexed). This is important because Microsoft Search is an essential component for other services such as eDiscovery. In a nutshell, no indexing meant that UDP-protected files were invisible outside SharePoint Online.
The news announced in MC1013467 addresses the problem, but in a very focused manner. Although the number of UDP-protected files stored in SharePoint Online is likely a very small percentage of the billions of new files created daily, there’s no way that a trawl across all sites to find and process UDP-protected files could work in a practical sense.
To solve the problem, SharePoint Online processes newly-created UDP-protected files from mid-March 2025 to make their content accessible to Microsoft Search. Once indexed by Search, the file content is available to other Microsoft 365 workloads like eDiscovery. During the indexing process, SharePoint interprets the permissions assigned to a file by the author to ensure that those with relevant permissions can engage in co-authoring. In addition, SharePoint Online and the Office apps need permission to access the file before the autosave feature can work. It takes a little time to process a new file after it is uploaded to SharePoint Online. Microsoft reckons on ten minutes, but I have experienced longer delays before features like autosave work.
Older files stored in sites remain inaccessible to SharePoint Online until the next time they are edited. At this point, SharePoint processes the file content to make it searchable. Over time, the idea is that the number of inaccessible UDP-protected files will gradually decrease, and the problem will go away. Once a file is processed by Search, it becomes available to content searches, eDiscovery, and DLP.
Even when UDP-protected files are processed by Microsoft Search, MC1013467 says that “files with labels configured for user-defined permissions will continue to not be available for Microsoft 365 Copilot processing.” In other words, although Search can find UDP-protected files, Copilot still does not have the necessary permissions to load content from those files to use when generating responses to user prompts.
No Big Change for Users in the Immediate Future
From a user perspective, the update for how SharePoint Online processes UDP-protected files won’t mean dramatic change in the immediate future. UDP sensitivity labels might become more popular and widespread, but that’s a process that needs time because it must be factored in the organization’s information protection policy, which is probably currently based on preconfigured permissions. Administrators will need time to absorb the news and figure out how and if UDP-protected files bring value to the business before they create and publish UPD labels.
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
Top Cloud Native Threats and Vulnerabilities of 2024
The complexity of cloud environments means that there is a virtually infinite list of potential security risks and vulnerabilities that could arise within cloud infrastructure or workloads. That said, some cloud security threats are more prevalent than others – and knowing which risks and vulnerabilities are trending is key to knowing what to prioritize when managing the attack surface for your organization. To that end, this article details seven of the most prominent cloud threats and vulnerabilities that emerged in 2024, including several discovered by Aqua researchers.
The complexity of cloud environments means that there is a virtually infinite list of potential security risks and vulnerabilities that could arise within cloud infrastructure or workloads. That said, some cloud security threats are more prevalent than others – and knowing which risks and vulnerabilities are trending is key to knowing what to prioritize when managing the attack surface for your organization. To that end, this article details seven of the most prominent cloud threats and vulnerabilities that emerged in 2024, including several discovered by Aqua researchers.
Read More
fixedpoint library linking issue with slbuild
I have a model with S-function which uses ssRegisterDataTypeFxpBinaryPoint for uint64, but I am getting error when try to create an executable with slbuild for my model.
It looks like linking error, how to link fixedpoint library when I create an executable of my model with slbuild.I have a model with S-function which uses ssRegisterDataTypeFxpBinaryPoint for uint64, but I am getting error when try to create an executable with slbuild for my model.
It looks like linking error, how to link fixedpoint library when I create an executable of my model with slbuild. I have a model with S-function which uses ssRegisterDataTypeFxpBinaryPoint for uint64, but I am getting error when try to create an executable with slbuild for my model.
It looks like linking error, how to link fixedpoint library when I create an executable of my model with slbuild. uint64, slbuild, simulink, lfixedpoint MATLAB Answers — New Questions
way to legend a data organized into colours in simple plot?
first_data = [[3 4 8 1];[3 6 4 9]]; % desired legend (first) & color (green)
second_data = [[1 3 5];[3 2 7];[3 4 2]]; % desired legend (second) & color (cyan)
combine = {first_data,second_data}; % recieving new data in every ‘for’ loop iteration thats why combining
colours = {‘g’,’c’};
Legend_Names = {‘first’,’second’};
for i = 1:length(combine)
plot(cell2mat(combine(i)),’Color’,cell2mat(colours(i)),’LineWidth’,2); grid on; hold on;
end
legend(Legend_Names)
i wish to plot my each data set with same colour… in this case legend ”Second” should have ”cyan” colourfirst_data = [[3 4 8 1];[3 6 4 9]]; % desired legend (first) & color (green)
second_data = [[1 3 5];[3 2 7];[3 4 2]]; % desired legend (second) & color (cyan)
combine = {first_data,second_data}; % recieving new data in every ‘for’ loop iteration thats why combining
colours = {‘g’,’c’};
Legend_Names = {‘first’,’second’};
for i = 1:length(combine)
plot(cell2mat(combine(i)),’Color’,cell2mat(colours(i)),’LineWidth’,2); grid on; hold on;
end
legend(Legend_Names)
i wish to plot my each data set with same colour… in this case legend ”Second” should have ”cyan” colour first_data = [[3 4 8 1];[3 6 4 9]]; % desired legend (first) & color (green)
second_data = [[1 3 5];[3 2 7];[3 4 2]]; % desired legend (second) & color (cyan)
combine = {first_data,second_data}; % recieving new data in every ‘for’ loop iteration thats why combining
colours = {‘g’,’c’};
Legend_Names = {‘first’,’second’};
for i = 1:length(combine)
plot(cell2mat(combine(i)),’Color’,cell2mat(colours(i)),’LineWidth’,2); grid on; hold on;
end
legend(Legend_Names)
i wish to plot my each data set with same colour… in this case legend ”Second” should have ”cyan” colour plot, legend MATLAB Answers — New Questions
Why do I write as Ib(1:478,31:565)(~BW) = 255
Ib(1:478,31:565)(~BW) = 255
Ib is a gray image. I want to set a fixed black region as blue, but this code is wrong.
Do we have simple method to finish it?Ib(1:478,31:565)(~BW) = 255
Ib is a gray image. I want to set a fixed black region as blue, but this code is wrong.
Do we have simple method to finish it? Ib(1:478,31:565)(~BW) = 255
Ib is a gray image. I want to set a fixed black region as blue, but this code is wrong.
Do we have simple method to finish it? matlab code MATLAB Answers — New Questions
Wind rose with no degrees for direction
I am trying to plot a wind rose but for direction I only have N, NE, NNE etc rather than degrees. Is there a code or script for this?I am trying to plot a wind rose but for direction I only have N, NE, NNE etc rather than degrees. Is there a code or script for this? I am trying to plot a wind rose but for direction I only have N, NE, NNE etc rather than degrees. Is there a code or script for this? windrose MATLAB Answers — New Questions
4×4 membrane switch set up
I’m trying to wire a 4×4 membrane switch to be able to input a string of numbers. The problem is A.) don’t have a lot of experience in matlab, and B.) all of the code libraries and stuff I’ve found for the switch is all based in the arduino software. Does anyone have any idea on how I can transfer it over or write my own?
here is a example of the arduino library:
#include “Keypad.h”
const byte ROWS = 4; // number of rows
const byte COLS = 3; // number of columns
char keys[ROWS][COLS] = {
{‘1′,’2′,’3’},
{‘4′,’5′,’6’},
{‘7′,’8′,’9’},
{‘#’,’0′,’*’}
};
byte rowPins[ROWS] = {8, 7, 6, 5}; // row pinouts of the keypad R1 = D8, R2 = D7, R3 = D6, R4 = D5
byte colPins[COLS] = {4, 3, 2}; // column pinouts of the keypad C1 = D4, C2 = D3, C3 = D2
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup()
{
Serial.begin(9600);
}
void loop()
{
char key = keypad.getKey();
if (key ~= NO_KEY)
Serial.println(key);
}I’m trying to wire a 4×4 membrane switch to be able to input a string of numbers. The problem is A.) don’t have a lot of experience in matlab, and B.) all of the code libraries and stuff I’ve found for the switch is all based in the arduino software. Does anyone have any idea on how I can transfer it over or write my own?
here is a example of the arduino library:
#include “Keypad.h”
const byte ROWS = 4; // number of rows
const byte COLS = 3; // number of columns
char keys[ROWS][COLS] = {
{‘1′,’2′,’3’},
{‘4′,’5′,’6’},
{‘7′,’8′,’9’},
{‘#’,’0′,’*’}
};
byte rowPins[ROWS] = {8, 7, 6, 5}; // row pinouts of the keypad R1 = D8, R2 = D7, R3 = D6, R4 = D5
byte colPins[COLS] = {4, 3, 2}; // column pinouts of the keypad C1 = D4, C2 = D3, C3 = D2
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup()
{
Serial.begin(9600);
}
void loop()
{
char key = keypad.getKey();
if (key ~= NO_KEY)
Serial.println(key);
} I’m trying to wire a 4×4 membrane switch to be able to input a string of numbers. The problem is A.) don’t have a lot of experience in matlab, and B.) all of the code libraries and stuff I’ve found for the switch is all based in the arduino software. Does anyone have any idea on how I can transfer it over or write my own?
here is a example of the arduino library:
#include “Keypad.h”
const byte ROWS = 4; // number of rows
const byte COLS = 3; // number of columns
char keys[ROWS][COLS] = {
{‘1′,’2′,’3’},
{‘4′,’5′,’6’},
{‘7′,’8′,’9’},
{‘#’,’0′,’*’}
};
byte rowPins[ROWS] = {8, 7, 6, 5}; // row pinouts of the keypad R1 = D8, R2 = D7, R3 = D6, R4 = D5
byte colPins[COLS] = {4, 3, 2}; // column pinouts of the keypad C1 = D4, C2 = D3, C3 = D2
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup()
{
Serial.begin(9600);
}
void loop()
{
char key = keypad.getKey();
if (key ~= NO_KEY)
Serial.println(key);
} keypad, membrane, button MATLAB Answers — New Questions
Microsoft Removes Reactivation Fee for Archived SharePoint Sites
No Microsoft 365 Archive Fee to Reactivate Sites After March 31, 2025
In a February 20, 2025 announcement, Microsoft said that they will remove reactivation fees for archived SharePoint Online sites. Some tenants will see the reduction in fees in early March and the change will roll out gradually worldwide for completion by the end of March 2025.
When Microsoft launched Microsoft 365 Archive, they charged $0.60 per GB to reactivate a site by moving its content from “cold” (long-term, archived) storage to “hot” (online, immediately-accessible) storage. Reactivation is immediate for sites archived within the last week, while sites archived for longer take approximately 24 hours to come back online.
Following the removal of the site reactivation fee, Microsoft will only charge the ongoing monthly storage cost of $0.05/GB. Storage fees don’t apply when they can be offset against the tenant’s unused SharePoint Online storage quota, so depending on how many sites they archive and how much content exists in those sites, some organizations might be able to use Microsoft 365 Archive for free.
A restriction does apply in that reactivated sites cannot be moved back into the archive for four months after reactivation. Microsoft says that the restriction is there to stop constant movement in and out of archive storage.
Keep Material Online but Prevent Copilot Access
One of the nice things about archiving sites is that it makes site content inaccessible for Microsoft 365 Copilot. There’s nothing worse than having AI-generated results being polluted by old, obsolete, and probably misleading information, and even if steps are taken to stop Copilot using content in its responses, Copilot can still find and use document library metadata because it exists in Microsoft Search.
I can’t think of a downside to moving old sites into the archive if you want to keep the material stored in the sites. Archived sites are still accessible for eDiscovery, the storage costs are a lot lower than hot online SharePoint storage, and now you can reactivate archived sites free when necessary.
Archived OneDrive Accounts
But you won’t be able to reactivate archived OneDrive for Business accounts free of charge because Microsoft excludes these objects from the removal of reactivation fees. The big idea behind automatically archiving unlicensed OneDrive for Business accounts is to force organizations to do something with accounts that might have been around for ten years or more. The unlicensed OneDrive accounts occupy valuable online storage and because Microsoft encourages the use of OneDrive for Business to hold all manner of files from Teams meeting recordings to PowerShell modules, a significant amount of storage can be occupied.
Microsoft released a report to help tenant administrators decide how to deal with unlicensed OneDrive for Business accounts in August 2024. By now, administrators should have a good handle on the unlicensed accounts within the tenant and know whether they will let automatic archiving happen (and be willing to pay the ongoing storage fees) or take action to remove the unlicensed accounts.
According to recently-revised Microsoft documentation, unlicensed accounts fall into two categories: those unlicensed before February 17, 2025, and those unlicensed afterward. The first batch includes all the historically unlicensed accounts. By April 25, 2025, these accounts will be in read-only mode to prepare them to move into the archive. This process will happen in the background and the unlicensed accounts will be archived by May 16, 2025, including the set shown in Figure 1. Once archived, tenants must pay to reactivate unlicensed OneDrive for Business accounts.

OneDrive for Business accounts that become unlicensed now are placed into read-only mode sixty days after they become unlicensed (for instance, the owning user account is deleted but the OneDrive data is kept by a retention policy, or the user account loses its license to allow them to use OneDrive for Business).
Thirty-three days afterward (93 days after the removal of the license), SharePoint Online will either move to the OneDrive account into the archive or into the recycle bin. Movement into the archive happens when a retention policy applies to the owner’s account.
Lower Fees are Always Appreciated
It’s good that Microsoft has removed the site reactivation fee. While not a lot in the overall scheme of things, getting rid of fees always encourage more use of facilities, and using Microsoft 365 Archive to store old material that the organization cannot remove is a good tactic. Some might question why the same logic doesn’t apply to archived OneDrive for Business accounts. That’s for Microsoft to answer, but I bet that they just want to get people used to the idea of paying to keep old OneDrive content online before they move on charges.
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
Where do i find sequence component for three-phase source for asymmetrical fault of bus system?
Three-phase fault (symmetrical & asymmetrical fault) of a 2 bus system.
I want to create fault using three-phase fault from simulink but the results are not the same as my calculations. I have verified that my calculation is correct but I cant seem to get the correct fault waveform from simulink as there are missing sequence components/parameters such as x0,x1,x2 at the source.
The transmission line with sequence parameters that I can find are pi model and distributed line parameters, are there only reactance model that has sequence parameters too?Three-phase fault (symmetrical & asymmetrical fault) of a 2 bus system.
I want to create fault using three-phase fault from simulink but the results are not the same as my calculations. I have verified that my calculation is correct but I cant seem to get the correct fault waveform from simulink as there are missing sequence components/parameters such as x0,x1,x2 at the source.
The transmission line with sequence parameters that I can find are pi model and distributed line parameters, are there only reactance model that has sequence parameters too? Three-phase fault (symmetrical & asymmetrical fault) of a 2 bus system.
I want to create fault using three-phase fault from simulink but the results are not the same as my calculations. I have verified that my calculation is correct but I cant seem to get the correct fault waveform from simulink as there are missing sequence components/parameters such as x0,x1,x2 at the source.
The transmission line with sequence parameters that I can find are pi model and distributed line parameters, are there only reactance model that has sequence parameters too? three-phase fault, sequence components, sequence parameters MATLAB Answers — New Questions
Uncertainty for exponential fitting
Hello,
I am using Curve Fitting Toolbox in MatLab, to fit single and double expoenential decays. (I’ve used cftool)
In this toolbox, the confidence interval is calculated for both the exponential coefficient and time. However, I do not know how to calculate uncertainty for exponential distribution? I need to report the time with uncertainty like this : t= 2.3 ± …
Would it be possible for someone to answer my question. Your help is really needed.
Thank you in advance,Hello,
I am using Curve Fitting Toolbox in MatLab, to fit single and double expoenential decays. (I’ve used cftool)
In this toolbox, the confidence interval is calculated for both the exponential coefficient and time. However, I do not know how to calculate uncertainty for exponential distribution? I need to report the time with uncertainty like this : t= 2.3 ± …
Would it be possible for someone to answer my question. Your help is really needed.
Thank you in advance, Hello,
I am using Curve Fitting Toolbox in MatLab, to fit single and double expoenential decays. (I’ve used cftool)
In this toolbox, the confidence interval is calculated for both the exponential coefficient and time. However, I do not know how to calculate uncertainty for exponential distribution? I need to report the time with uncertainty like this : t= 2.3 ± …
Would it be possible for someone to answer my question. Your help is really needed.
Thank you in advance, exponential fitting, curve fitting, uncertainty MATLAB Answers — New Questions
Simulink model of avarage values model of buck converter with Pi current control
Hello, how can I model an avarage values model of a buck converter with a PI current control. The idea was to go in p.u. values and with a basic pi loop that generate the Duty cycle (in p.u. taking as base the max load is equivalent to the voltage in p.u.) that is entering the controlled voltage source block (Simscape-9) that is feeding a resistance (load) through an filtering inductance.
can you give me a schematic in simulink of the model?
thanks
something like thatHello, how can I model an avarage values model of a buck converter with a PI current control. The idea was to go in p.u. values and with a basic pi loop that generate the Duty cycle (in p.u. taking as base the max load is equivalent to the voltage in p.u.) that is entering the controlled voltage source block (Simscape-9) that is feeding a resistance (load) through an filtering inductance.
can you give me a schematic in simulink of the model?
thanks
something like that Hello, how can I model an avarage values model of a buck converter with a PI current control. The idea was to go in p.u. values and with a basic pi loop that generate the Duty cycle (in p.u. taking as base the max load is equivalent to the voltage in p.u.) that is entering the controlled voltage source block (Simscape-9) that is feeding a resistance (load) through an filtering inductance.
can you give me a schematic in simulink of the model?
thanks
something like that dc dc, buck, current pi control, avarage values model, controlled voltage source, simscape electrical, duty cycle, per unit MATLAB Answers — New Questions
I am trying to plot a graph using mathematical formulas.
Hello everyone, I am trying to obtain the following graph using the explanations below, but I am getting a different result. I would really appreciate it if you could help me find the error.
explanations:
my code:
clear all
clc
% Parameters
epsilon0 = 8.85e-12;
epsilon_m = 79;
CM = 0.5;
k_B = 1.38e-23;
R = 1e-6;
gamma = 1.88e-8;
q = 1e-14;
dt = 1e-3;
T = 300;
x0 = 10e-6;
num_steps = 1000;
N = 100000;
epsilon = 1e-9;
k = 1 / (4 * pi * epsilon_m);
% **Creating matrices to store FDEP force and positions**
x_dep = zeros(num_steps, N);
x_diff = zeros(num_steps, N);
FDEP = zeros(num_steps, N);
% **Initial Positions**
x_dep(1, 🙂 = x0;
x_diff(1, 🙂 = x0;
% **Generating random numbers for Brownian motion**
rng(0);
% **Loop for 100,000 Simulations (Each Simulation Runs Independently!)**
for sim = 1:N
% **Generate random Gaussian noise for each particle**
W = randn(num_steps, 1);
for i = 1:num_steps-1
% **Calculate FDEP separately for each particle**
FDEP(i, sim) = 4 * pi * R^3 * epsilon0 * epsilon_m * CM * (-2 * k^2 * q^2) / ((abs(x_dep(i, sim) – x0) + epsilon)^5);
% **Motion under the effect of FDEP (Used for Correct Simulation)**
x_dep(i+1, sim) = x_dep(i, sim) + (FDEP(i, sim) / gamma) * dt + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i);
% **Pure diffusion (without DEP force)**
x_diff(i+1, sim) = x_diff(i, sim) + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i);
end
end
% **Calculate Mean Positions**
x_mean_dep = mean(x_dep, 2);
x_mean_diff = mean(x_diff, 2);
% **Plot the Graph**
figure;
plot((0:num_steps-1) * dt, x_mean_dep * 1e6, ‘b’, ‘LineWidth’, 1.5);
hold on;
plot((0:num_steps-1) * dt, x_mean_diff * 1e6, ‘r–‘, ‘LineWidth’, 1.5);
xlabel(‘Time (s)’);
ylabel(‘Position (μm)’);
title(‘Particle Motion Under the Effect of Dielectrophoretic Force’);
legend(‘Diffusion under F_{DEP}’, ‘Pure diffusion’);
grid on;
hold off;Hello everyone, I am trying to obtain the following graph using the explanations below, but I am getting a different result. I would really appreciate it if you could help me find the error.
explanations:
my code:
clear all
clc
% Parameters
epsilon0 = 8.85e-12;
epsilon_m = 79;
CM = 0.5;
k_B = 1.38e-23;
R = 1e-6;
gamma = 1.88e-8;
q = 1e-14;
dt = 1e-3;
T = 300;
x0 = 10e-6;
num_steps = 1000;
N = 100000;
epsilon = 1e-9;
k = 1 / (4 * pi * epsilon_m);
% **Creating matrices to store FDEP force and positions**
x_dep = zeros(num_steps, N);
x_diff = zeros(num_steps, N);
FDEP = zeros(num_steps, N);
% **Initial Positions**
x_dep(1, 🙂 = x0;
x_diff(1, 🙂 = x0;
% **Generating random numbers for Brownian motion**
rng(0);
% **Loop for 100,000 Simulations (Each Simulation Runs Independently!)**
for sim = 1:N
% **Generate random Gaussian noise for each particle**
W = randn(num_steps, 1);
for i = 1:num_steps-1
% **Calculate FDEP separately for each particle**
FDEP(i, sim) = 4 * pi * R^3 * epsilon0 * epsilon_m * CM * (-2 * k^2 * q^2) / ((abs(x_dep(i, sim) – x0) + epsilon)^5);
% **Motion under the effect of FDEP (Used for Correct Simulation)**
x_dep(i+1, sim) = x_dep(i, sim) + (FDEP(i, sim) / gamma) * dt + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i);
% **Pure diffusion (without DEP force)**
x_diff(i+1, sim) = x_diff(i, sim) + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i);
end
end
% **Calculate Mean Positions**
x_mean_dep = mean(x_dep, 2);
x_mean_diff = mean(x_diff, 2);
% **Plot the Graph**
figure;
plot((0:num_steps-1) * dt, x_mean_dep * 1e6, ‘b’, ‘LineWidth’, 1.5);
hold on;
plot((0:num_steps-1) * dt, x_mean_diff * 1e6, ‘r–‘, ‘LineWidth’, 1.5);
xlabel(‘Time (s)’);
ylabel(‘Position (μm)’);
title(‘Particle Motion Under the Effect of Dielectrophoretic Force’);
legend(‘Diffusion under F_{DEP}’, ‘Pure diffusion’);
grid on;
hold off; Hello everyone, I am trying to obtain the following graph using the explanations below, but I am getting a different result. I would really appreciate it if you could help me find the error.
explanations:
my code:
clear all
clc
% Parameters
epsilon0 = 8.85e-12;
epsilon_m = 79;
CM = 0.5;
k_B = 1.38e-23;
R = 1e-6;
gamma = 1.88e-8;
q = 1e-14;
dt = 1e-3;
T = 300;
x0 = 10e-6;
num_steps = 1000;
N = 100000;
epsilon = 1e-9;
k = 1 / (4 * pi * epsilon_m);
% **Creating matrices to store FDEP force and positions**
x_dep = zeros(num_steps, N);
x_diff = zeros(num_steps, N);
FDEP = zeros(num_steps, N);
% **Initial Positions**
x_dep(1, 🙂 = x0;
x_diff(1, 🙂 = x0;
% **Generating random numbers for Brownian motion**
rng(0);
% **Loop for 100,000 Simulations (Each Simulation Runs Independently!)**
for sim = 1:N
% **Generate random Gaussian noise for each particle**
W = randn(num_steps, 1);
for i = 1:num_steps-1
% **Calculate FDEP separately for each particle**
FDEP(i, sim) = 4 * pi * R^3 * epsilon0 * epsilon_m * CM * (-2 * k^2 * q^2) / ((abs(x_dep(i, sim) – x0) + epsilon)^5);
% **Motion under the effect of FDEP (Used for Correct Simulation)**
x_dep(i+1, sim) = x_dep(i, sim) + (FDEP(i, sim) / gamma) * dt + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i);
% **Pure diffusion (without DEP force)**
x_diff(i+1, sim) = x_diff(i, sim) + sqrt(2 * k_B * T / gamma) * sqrt(dt) * W(i);
end
end
% **Calculate Mean Positions**
x_mean_dep = mean(x_dep, 2);
x_mean_diff = mean(x_diff, 2);
% **Plot the Graph**
figure;
plot((0:num_steps-1) * dt, x_mean_dep * 1e6, ‘b’, ‘LineWidth’, 1.5);
hold on;
plot((0:num_steps-1) * dt, x_mean_diff * 1e6, ‘r–‘, ‘LineWidth’, 1.5);
xlabel(‘Time (s)’);
ylabel(‘Position (μm)’);
title(‘Particle Motion Under the Effect of Dielectrophoretic Force’);
legend(‘Diffusion under F_{DEP}’, ‘Pure diffusion’);
grid on;
hold off; mathematics, signal processing, signal, graph, graphics, matrices, matlab, differential equations MATLAB Answers — New Questions
Find Source of Warning: This model contains blocks that do not handle sample time changes at runtime.
I am getting the following warning when building a model for Simulink RealTime:
Warning: This model contains blocks that do not handle sample time
changes at runtime. To avoid incorrect results, only change
the sample time in the original model, then rebuild the model.
There are no other warnings when building the model. How can I find which block(s) are responsible for this warning or the reason for the warning?
More Info:
I am using the following system target file:
System Target File: C:Program FilesMATLABR2019atoolboxslrtrtwslrt.tlc
I am using the Microsoft Visual C++ 2019 (C) compiler
The warning is generated by the following private function:
function xpcSampleTimeWarning
% Simulink Real-Time private function
% Copyright 2008 The MathWorks, Inc.
warning(message(‘xPCTarget:sampleTime:sampleTimeInvariance’));
Runing various model advisor checks yielded no help.I am getting the following warning when building a model for Simulink RealTime:
Warning: This model contains blocks that do not handle sample time
changes at runtime. To avoid incorrect results, only change
the sample time in the original model, then rebuild the model.
There are no other warnings when building the model. How can I find which block(s) are responsible for this warning or the reason for the warning?
More Info:
I am using the following system target file:
System Target File: C:Program FilesMATLABR2019atoolboxslrtrtwslrt.tlc
I am using the Microsoft Visual C++ 2019 (C) compiler
The warning is generated by the following private function:
function xpcSampleTimeWarning
% Simulink Real-Time private function
% Copyright 2008 The MathWorks, Inc.
warning(message(‘xPCTarget:sampleTime:sampleTimeInvariance’));
Runing various model advisor checks yielded no help. I am getting the following warning when building a model for Simulink RealTime:
Warning: This model contains blocks that do not handle sample time
changes at runtime. To avoid incorrect results, only change
the sample time in the original model, then rebuild the model.
There are no other warnings when building the model. How can I find which block(s) are responsible for this warning or the reason for the warning?
More Info:
I am using the following system target file:
System Target File: C:Program FilesMATLABR2019atoolboxslrtrtwslrt.tlc
I am using the Microsoft Visual C++ 2019 (C) compiler
The warning is generated by the following private function:
function xpcSampleTimeWarning
% Simulink Real-Time private function
% Copyright 2008 The MathWorks, Inc.
warning(message(‘xPCTarget:sampleTime:sampleTimeInvariance’));
Runing various model advisor checks yielded no help. simulink, simulink realtime, code generation MATLAB Answers — New Questions
Microsoft Graph PowerShell SDK Runs into Choppy Waters
Graph SDK V2.26 Issues Make the Software Unusable
The Microsoft Graph PowerShell SDK is becoming increasingly popular. With over 3.5 million downloads of the previous version, a new release was bound to be a major event., especially after a three-month delay since Microsoft released V2.25 on November 21, 2024 (the SDK usually follows a monthly release cadence). V2.26 duly arrived five days ago.
Alas, you should avoid and not install V2.26. The release is buggy, exhibits little evidence of being tested before launch, and creates huge operational problems for Azure Automation-based runbooks.
The Cracks Appear
I installed V2.26 soon after it appeared in the PowerShell Gallery. I have a large number of PowerShell scripts and runbooks based on the Microsoft Graph PowerShell SDK and it didn’t take long before cracks appeared. For example, HTML messages generated by the Send-MgUserMail cmdlet didn’t display property in multiple email clients, including Outlook classic, the new Outlook, OWA, and Proton (Figure 1).

Another issue was that the Send-MgUserMail cmdlet failed to process attachments. The script I published last week to show how to add and send multiple attachments with Outlook messages failed spectacularly. Many production scripts use Send-MgUserMail to generate and send HTML formatted messages, so this issue was a big problem for a new release.
To be fair to Microsoft, they quickly fixed the two Send-MgUserMail issues. However, these weren’t the only problems. For instance, the New-MgGroupMember cmdlet failed because of an “invalid URL format” generated by an odd value appended to the request URI created for the POST request to add a new group member.
As is my norm, I reported the issues as I encountered problems (anyone who finds a problem with the Microsoft Graph PowerShell SDK, can report the issue online). After a couple of hours, it was evident that V2.26 was in bad shape and practically unusable.
The Big Issue
Discovering several Priority 1 issues in a short period is bad enough; finding that V2.26 had dropped support for .NET6 and .NET7 without warning delivered the coup de grace. This news is a bullet point in the Microsoft Graph PowerShell SDK release notes, which is nice if you read that information and understand the full consequences of the removal. Microsoft delivered no context for the change and no commentary as to what might be the effect.
Issue #3151 was the first report that came in to advise that Azure Automation runbooks had stopped working with V2.26. As you might recall, before Microsoft Graph PowerShell SDK cmdlets can be used with Azure Automation, the modules containing the cmdlets must be loaded as resources into the automation account. You can then create runbooks based on a specific PowerShell version and use the cmdlets in those runbooks.
Azure Automation supports runbooks based on PowerShell V5.1, V7.1. and V7.2. Sometimes a module only supports V5.1 (the SharePoint Online management module is an example), but usually it’s recommended to use PowerShell 7. The problem introduced with the new version of the SDK is that PowerShell V7.1 and V7.2 don’t use .NET 8. Because the SDK dropped support for .NET6 (which reached end of support in November 2024) and .NET7 (which reached end of support in May 2024), Azure Automation and the Microsoft Graph PowerShell SDK are now at odds with each other.
To demonstrate, I created a new automation account and loaded the Microsoft.Graph.Authentication module into the account (Figure 2). This module is the foundation of the Microsoft Graph PowerShell SDK because all other modules have a dependency on it. Note that the runtime version is PowerShell 7.2.

Next, I created a very simple runbook to sign into the Graph using a managed identity (Figure 3). The only processing performed by the runbook is to sign in and report the authentication context.

When I ran the runbook, it failed because the runbook couldn’t load an assembly it needed to run the Connect-MgGraph cmdlet. This isn’t surprising because PowerShell 7.2 is looking for a file that it doesn’t support or isn’t available.

Stay with V2.25
You won’t have a problem if automation accounts keep on using V2.25. You will have problems if you upgrade automation accounts to use the V2.26 modules or create new automation accounts and load the V2.26 modules (which is what Azure Automation offers) as account resources. Some workarounds have been suggested, such as using the Azure Runtime Environment, but that’s a preview feature and I don’t recommend using it in production. You’re safer by leaving the V2.25 modules in place and not attempting to upgrade.
A Big Mess
It’s obvious that V2.26 of the Microsoft Graph PowerShell SDK is a big mess. It’s not the only fiasco in SDK history as previous problems were experienced in V2.14 and V2.17/V2.18 in 2024. It’s obvious that Microsoft didn’t test this release thoroughly before pushing it out the door. It’s also clear that Microsoft failed to appreciate or communicate the impact of removing support for .NET6 and .NET7 on Azure Automation. I don’t recall seeing a support article that clearly outlines how V2.26 affects Azure Automation that might convince customers to pause upgrading to V2.26.
Although the two .NET releases are retired, PowerShell in Azure Automation hasn’t moved on to support PowerShell V7.5. Perhaps that’s because the Azure Automation development team know that dropping support for PowerShell V7.1 and V7.2 might break many production runbooks. Still, that’s an internal issue for Microsoft to work out between the development groups. Customers shouldn’t have to experience the downside of the lack of coordination and planning that obviously exists within the world’s largest software company.
If you’re one of the 150,000 who downloaded V2.26 SDK, it’s time to bin it and revert to V2.25. At least that version works.
Need some assistance to write and manage PowerShell scripts for Microsoft 365? 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.
Removing bias drift from integration of noisy signal
Hello,
I am working on a Simulink simulation where I need to perform a double integration of a noisy signal. The input signal is generated by exciting the system with a chirp signal that varies in frequency from 0.01 Hz to 10 Hz. To reduce noise before integration, I apply a moving mean filter.
However, despite the filtering, the double-integrated signal exhibits an unwanted upward trend (bias drift), which should not be present. I suspect this may be due to numerical drift and low-frequency components.
What would be the best approach to mitigate this bias? Should I use a different filtering technique, remove the DC component, or apply a different integration method?
I have attached plots showing:
The signal pre filtering
The signal after filtering
The output after single and double integration, highlighting the bias issue
Any advice would be greatly appreciated. Thank you!Hello,
I am working on a Simulink simulation where I need to perform a double integration of a noisy signal. The input signal is generated by exciting the system with a chirp signal that varies in frequency from 0.01 Hz to 10 Hz. To reduce noise before integration, I apply a moving mean filter.
However, despite the filtering, the double-integrated signal exhibits an unwanted upward trend (bias drift), which should not be present. I suspect this may be due to numerical drift and low-frequency components.
What would be the best approach to mitigate this bias? Should I use a different filtering technique, remove the DC component, or apply a different integration method?
I have attached plots showing:
The signal pre filtering
The signal after filtering
The output after single and double integration, highlighting the bias issue
Any advice would be greatly appreciated. Thank you! Hello,
I am working on a Simulink simulation where I need to perform a double integration of a noisy signal. The input signal is generated by exciting the system with a chirp signal that varies in frequency from 0.01 Hz to 10 Hz. To reduce noise before integration, I apply a moving mean filter.
However, despite the filtering, the double-integrated signal exhibits an unwanted upward trend (bias drift), which should not be present. I suspect this may be due to numerical drift and low-frequency components.
What would be the best approach to mitigate this bias? Should I use a different filtering technique, remove the DC component, or apply a different integration method?
I have attached plots showing:
The signal pre filtering
The signal after filtering
The output after single and double integration, highlighting the bias issue
Any advice would be greatly appreciated. Thank you! remove trends, bias, noise, simulink, identification MATLAB Answers — New Questions
Model variable/jittered clock to sample a signal in Simulink – how does variable sample times work?
I’m trying to understand the impact of a clock jitter in an embedded system and its effect on an FFT calculation.
Thus, I’m creating a jittered clock in Simulink, which triggers a sample & hold subsystem, which shall create discrete samples (like in an ADC) of a continuous 20 Hz sine input signal.
Due to the jittered nature of the clock, I can’t use a fixed sample rate (or would need to choose a way higher sample rate to model the jitter), thus I chose the auto solver and continuous sample rates.
Sample rate legend:
I tried to follow Model Effect of Temperature and Jitter on Crystal Oscillation Frequency and created two options for the clock generation, hit scheduler and the variable pulse generator, but those seem not to make any difference.
In the model, you can choose to enable or disable the jitter. f0 is the nominal clock frequency, which is 1 kHz in this example.
There’s also a counter to visualize the number of clock cycles. Assuming a simulation time of 2.048 s, exactly 2048 clock cycles are generated, assuming no jitter, which makes sense given the 1 kHz clock. On my PC, when I enable the jitter, only 1822 clock cycles are present.
Below you can see the input signal (20 Hz sine), the clock, and the sampled signal:
In the detail view you can see the desired unsteady clock and the sampled signal.
While this looks good at the first glance, I was wondering, how many data points per step are really generated? Can the be answered given that SL chooses the variable sample rate? Is there a way to generate exactly one data point/sample per clock trigger?
If the clock was stable, I’d use a rate transition (which is in the model, see the screenshot). But rate transitions can’t have variable sample rates, e.g. via an in-port it seems.
My next steps would be to calculate the FFT on those samples. But I’m not sure how to make sure that there’s one sample per clock.
In the model you can see various approaches I’ve tried to use to calculate the FFT, but I’m not sure if any is correct.
Unfortunately, the Spectrum Analyzer as well as the buffer blocks need non-continuous sample rates, thus the rate transition seems to be the only choice? But that implies a constant sample rate, which is not true…
Another trial was to calculate the FFT in a MATLAB function but not sure if that approach is correct.
Ultimately I want to estimate the error of the frequency bin estimation in the FFT given an unstable clock. I.e., when there’s no jitter in the clock, the 20 Hz sine should appear perfectly. But what if there’s a jitter?
Can the Spectrum Analyzer block used without discrete sample rates?
Are there any concepts I could use I’m not aware of? Right now I’m using normal rising edge triggers, would function-call triggers change something? Again, I’d like to make sure that there’s exactly one data point/sample available per clock edge – just like it would be in the embedded device’s ADC interrupt.
Is the problem clear? You need any more information?
Thanks for any input,
Jan
The model is attached for your reference.I’m trying to understand the impact of a clock jitter in an embedded system and its effect on an FFT calculation.
Thus, I’m creating a jittered clock in Simulink, which triggers a sample & hold subsystem, which shall create discrete samples (like in an ADC) of a continuous 20 Hz sine input signal.
Due to the jittered nature of the clock, I can’t use a fixed sample rate (or would need to choose a way higher sample rate to model the jitter), thus I chose the auto solver and continuous sample rates.
Sample rate legend:
I tried to follow Model Effect of Temperature and Jitter on Crystal Oscillation Frequency and created two options for the clock generation, hit scheduler and the variable pulse generator, but those seem not to make any difference.
In the model, you can choose to enable or disable the jitter. f0 is the nominal clock frequency, which is 1 kHz in this example.
There’s also a counter to visualize the number of clock cycles. Assuming a simulation time of 2.048 s, exactly 2048 clock cycles are generated, assuming no jitter, which makes sense given the 1 kHz clock. On my PC, when I enable the jitter, only 1822 clock cycles are present.
Below you can see the input signal (20 Hz sine), the clock, and the sampled signal:
In the detail view you can see the desired unsteady clock and the sampled signal.
While this looks good at the first glance, I was wondering, how many data points per step are really generated? Can the be answered given that SL chooses the variable sample rate? Is there a way to generate exactly one data point/sample per clock trigger?
If the clock was stable, I’d use a rate transition (which is in the model, see the screenshot). But rate transitions can’t have variable sample rates, e.g. via an in-port it seems.
My next steps would be to calculate the FFT on those samples. But I’m not sure how to make sure that there’s one sample per clock.
In the model you can see various approaches I’ve tried to use to calculate the FFT, but I’m not sure if any is correct.
Unfortunately, the Spectrum Analyzer as well as the buffer blocks need non-continuous sample rates, thus the rate transition seems to be the only choice? But that implies a constant sample rate, which is not true…
Another trial was to calculate the FFT in a MATLAB function but not sure if that approach is correct.
Ultimately I want to estimate the error of the frequency bin estimation in the FFT given an unstable clock. I.e., when there’s no jitter in the clock, the 20 Hz sine should appear perfectly. But what if there’s a jitter?
Can the Spectrum Analyzer block used without discrete sample rates?
Are there any concepts I could use I’m not aware of? Right now I’m using normal rising edge triggers, would function-call triggers change something? Again, I’d like to make sure that there’s exactly one data point/sample available per clock edge – just like it would be in the embedded device’s ADC interrupt.
Is the problem clear? You need any more information?
Thanks for any input,
Jan
The model is attached for your reference. I’m trying to understand the impact of a clock jitter in an embedded system and its effect on an FFT calculation.
Thus, I’m creating a jittered clock in Simulink, which triggers a sample & hold subsystem, which shall create discrete samples (like in an ADC) of a continuous 20 Hz sine input signal.
Due to the jittered nature of the clock, I can’t use a fixed sample rate (or would need to choose a way higher sample rate to model the jitter), thus I chose the auto solver and continuous sample rates.
Sample rate legend:
I tried to follow Model Effect of Temperature and Jitter on Crystal Oscillation Frequency and created two options for the clock generation, hit scheduler and the variable pulse generator, but those seem not to make any difference.
In the model, you can choose to enable or disable the jitter. f0 is the nominal clock frequency, which is 1 kHz in this example.
There’s also a counter to visualize the number of clock cycles. Assuming a simulation time of 2.048 s, exactly 2048 clock cycles are generated, assuming no jitter, which makes sense given the 1 kHz clock. On my PC, when I enable the jitter, only 1822 clock cycles are present.
Below you can see the input signal (20 Hz sine), the clock, and the sampled signal:
In the detail view you can see the desired unsteady clock and the sampled signal.
While this looks good at the first glance, I was wondering, how many data points per step are really generated? Can the be answered given that SL chooses the variable sample rate? Is there a way to generate exactly one data point/sample per clock trigger?
If the clock was stable, I’d use a rate transition (which is in the model, see the screenshot). But rate transitions can’t have variable sample rates, e.g. via an in-port it seems.
My next steps would be to calculate the FFT on those samples. But I’m not sure how to make sure that there’s one sample per clock.
In the model you can see various approaches I’ve tried to use to calculate the FFT, but I’m not sure if any is correct.
Unfortunately, the Spectrum Analyzer as well as the buffer blocks need non-continuous sample rates, thus the rate transition seems to be the only choice? But that implies a constant sample rate, which is not true…
Another trial was to calculate the FFT in a MATLAB function but not sure if that approach is correct.
Ultimately I want to estimate the error of the frequency bin estimation in the FFT given an unstable clock. I.e., when there’s no jitter in the clock, the 20 Hz sine should appear perfectly. But what if there’s a jitter?
Can the Spectrum Analyzer block used without discrete sample rates?
Are there any concepts I could use I’m not aware of? Right now I’m using normal rising edge triggers, would function-call triggers change something? Again, I’d like to make sure that there’s exactly one data point/sample available per clock edge – just like it would be in the embedded device’s ADC interrupt.
Is the problem clear? You need any more information?
Thanks for any input,
Jan
The model is attached for your reference. simulink, clock jitter, fft, sampling, rate transition MATLAB Answers — New Questions
find is not working in a loop, it skips numbers
Hello,
I am using a loop with a "find" to indentify the rows in the third column that have the same number (e.g. 0.75 etc), then I select which to chose based on a criterio. In some cases for example 0.82, 0.93 the function find returns a zero array instead of an array with ones at the locations of the number. Depending on the limits of the initial range ("sisto" in the code below) it skips different number. I tried to correct using the mask instead of the find but I am still having the same results. Could you please help me with this? (I attach the text file with the input matrix) Thanks.
load(‘HP4140AT5OR40DOS.txt’);
LINE=HP4140AT5OR40DOS;
x=LINE(:,3);
sisto = 0.60:0.01:1;
s=size(sisto,2)
for i=1:s
sisto(i)
find = (x==sisto(i));
MA=LINE(find,:)
dast=MA(:,5); %the storage days
ouf=abs(40-dast)% how close they are to 30
[minValue, minIndex] = min(ouf)
point=MA(minIndex,:)%the point I select for this wind contribution
endHello,
I am using a loop with a "find" to indentify the rows in the third column that have the same number (e.g. 0.75 etc), then I select which to chose based on a criterio. In some cases for example 0.82, 0.93 the function find returns a zero array instead of an array with ones at the locations of the number. Depending on the limits of the initial range ("sisto" in the code below) it skips different number. I tried to correct using the mask instead of the find but I am still having the same results. Could you please help me with this? (I attach the text file with the input matrix) Thanks.
load(‘HP4140AT5OR40DOS.txt’);
LINE=HP4140AT5OR40DOS;
x=LINE(:,3);
sisto = 0.60:0.01:1;
s=size(sisto,2)
for i=1:s
sisto(i)
find = (x==sisto(i));
MA=LINE(find,:)
dast=MA(:,5); %the storage days
ouf=abs(40-dast)% how close they are to 30
[minValue, minIndex] = min(ouf)
point=MA(minIndex,:)%the point I select for this wind contribution
end Hello,
I am using a loop with a "find" to indentify the rows in the third column that have the same number (e.g. 0.75 etc), then I select which to chose based on a criterio. In some cases for example 0.82, 0.93 the function find returns a zero array instead of an array with ones at the locations of the number. Depending on the limits of the initial range ("sisto" in the code below) it skips different number. I tried to correct using the mask instead of the find but I am still having the same results. Could you please help me with this? (I attach the text file with the input matrix) Thanks.
load(‘HP4140AT5OR40DOS.txt’);
LINE=HP4140AT5OR40DOS;
x=LINE(:,3);
sisto = 0.60:0.01:1;
s=size(sisto,2)
for i=1:s
sisto(i)
find = (x==sisto(i));
MA=LINE(find,:)
dast=MA(:,5); %the storage days
ouf=abs(40-dast)% how close they are to 30
[minValue, minIndex] = min(ouf)
point=MA(minIndex,:)%the point I select for this wind contribution
end find, loop, skips MATLAB Answers — New Questions