Month: May 2024
S-Function cannot find a file (.exe) but it is clearly in the Matlab path
Hello,
I am working with a third party software (CarSim 2021) that is using a controller provided by a supplier as a black box. I have added Directory1 and its sub-folders to the Matlab path. The error message is (some names modified):
Error reported by S-function ‘Sfun_GenericSM_blahblah’ in ‘Directory1/Directory2/Directory3/Controller/ESP Controller Interface/ESP8’:
===> !!! Error GetLastError(2): File anExecutable.exe does not exist !!!
I can navigate to the .exe file and run it in my working directory within Directory1. I copied "anExecutable.exe" in additional locations within the Directory1 and Directory2 to address any potential path issue. I do see Sfun_GenericSM_blahblah.mexw64 in the path (as mentioned in https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path).
I know this model ran on a different machine in the past; but, not sure about the Matlab version. I used both Matlab 2017b and 2023b. I get the same error.
I do not have access to the source code and the block SFunction parameters does not explicitly refer to the .exe file when I open the block parameters dialouge box.
Is there a way to point the model to the file (.exe) that it cannot find?
Thanks for the help!Hello,
I am working with a third party software (CarSim 2021) that is using a controller provided by a supplier as a black box. I have added Directory1 and its sub-folders to the Matlab path. The error message is (some names modified):
Error reported by S-function ‘Sfun_GenericSM_blahblah’ in ‘Directory1/Directory2/Directory3/Controller/ESP Controller Interface/ESP8’:
===> !!! Error GetLastError(2): File anExecutable.exe does not exist !!!
I can navigate to the .exe file and run it in my working directory within Directory1. I copied "anExecutable.exe" in additional locations within the Directory1 and Directory2 to address any potential path issue. I do see Sfun_GenericSM_blahblah.mexw64 in the path (as mentioned in https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path).
I know this model ran on a different machine in the past; but, not sure about the Matlab version. I used both Matlab 2017b and 2023b. I get the same error.
I do not have access to the source code and the block SFunction parameters does not explicitly refer to the .exe file when I open the block parameters dialouge box.
Is there a way to point the model to the file (.exe) that it cannot find?
Thanks for the help! Hello,
I am working with a third party software (CarSim 2021) that is using a controller provided by a supplier as a black box. I have added Directory1 and its sub-folders to the Matlab path. The error message is (some names modified):
Error reported by S-function ‘Sfun_GenericSM_blahblah’ in ‘Directory1/Directory2/Directory3/Controller/ESP Controller Interface/ESP8’:
===> !!! Error GetLastError(2): File anExecutable.exe does not exist !!!
I can navigate to the .exe file and run it in my working directory within Directory1. I copied "anExecutable.exe" in additional locations within the Directory1 and Directory2 to address any potential path issue. I do see Sfun_GenericSM_blahblah.mexw64 in the path (as mentioned in https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path).
I know this model ran on a different machine in the past; but, not sure about the Matlab version. I used both Matlab 2017b and 2023b. I get the same error.
I do not have access to the source code and the block SFunction parameters does not explicitly refer to the .exe file when I open the block parameters dialouge box.
Is there a way to point the model to the file (.exe) that it cannot find?
Thanks for the help! sfunction, finding external file, path problem MATLAB Answers — New Questions
Best way to buffer vector data in Simulink for processing over a time window
I’m working with a lidar-equipped robot, and every 0.2 seconds it provides an array of 360 values corresponding to the return intensity received at each angle. For my application, I need to do some statistical analysis on the data over a user-defined time-window. For offline processing in MATLAB, I’ve just been appending each new array of scan values to a matrix, so that I have a 360-column "Intensities" matrix which grows over time, and I can select the time-window for processing by selecting the appropriate rows from the matrix.
intensitiesMatrix(i,:) = new_scandata_array;
Now I’m trying to transition my code to Simulink (particularly because I want to use Stateflow for certain aspects of my application) and I want to do the same kind of data buffering so I can perform windowed processing on the data in real-time. For some reason I’m having a hard time figuring out the best way to collect my successive scan vectors into a form that I can then process, as I did in my regular MATLAB approach. I’ve looked a bit at Data Stores; is that the right approach? Or is there a good way to do this with matrices as I was doing in MATLAB?I’m working with a lidar-equipped robot, and every 0.2 seconds it provides an array of 360 values corresponding to the return intensity received at each angle. For my application, I need to do some statistical analysis on the data over a user-defined time-window. For offline processing in MATLAB, I’ve just been appending each new array of scan values to a matrix, so that I have a 360-column "Intensities" matrix which grows over time, and I can select the time-window for processing by selecting the appropriate rows from the matrix.
intensitiesMatrix(i,:) = new_scandata_array;
Now I’m trying to transition my code to Simulink (particularly because I want to use Stateflow for certain aspects of my application) and I want to do the same kind of data buffering so I can perform windowed processing on the data in real-time. For some reason I’m having a hard time figuring out the best way to collect my successive scan vectors into a form that I can then process, as I did in my regular MATLAB approach. I’ve looked a bit at Data Stores; is that the right approach? Or is there a good way to do this with matrices as I was doing in MATLAB? I’m working with a lidar-equipped robot, and every 0.2 seconds it provides an array of 360 values corresponding to the return intensity received at each angle. For my application, I need to do some statistical analysis on the data over a user-defined time-window. For offline processing in MATLAB, I’ve just been appending each new array of scan values to a matrix, so that I have a 360-column "Intensities" matrix which grows over time, and I can select the time-window for processing by selecting the appropriate rows from the matrix.
intensitiesMatrix(i,:) = new_scandata_array;
Now I’m trying to transition my code to Simulink (particularly because I want to use Stateflow for certain aspects of my application) and I want to do the same kind of data buffering so I can perform windowed processing on the data in real-time. For some reason I’m having a hard time figuring out the best way to collect my successive scan vectors into a form that I can then process, as I did in my regular MATLAB approach. I’ve looked a bit at Data Stores; is that the right approach? Or is there a good way to do this with matrices as I was doing in MATLAB? simulink data processing MATLAB Answers — New Questions
MATLAB to CPP code
In MATLAB, it is quite convenient to implement reading binary files with data types that are not several-integer-number of bytes, like
data = fread(fid, fsize, ‘bit12’);
I feel extremely frustrated about how to correctly convert this expression to C++ code?In MATLAB, it is quite convenient to implement reading binary files with data types that are not several-integer-number of bytes, like
data = fread(fid, fsize, ‘bit12’);
I feel extremely frustrated about how to correctly convert this expression to C++ code? In MATLAB, it is quite convenient to implement reading binary files with data types that are not several-integer-number of bytes, like
data = fread(fid, fsize, ‘bit12’);
I feel extremely frustrated about how to correctly convert this expression to C++ code? matlab and cpp MATLAB Answers — New Questions
Error: Excel doe’snt recognise the formula and tells me to start it with “=” sign
I am establishing a blood electrolytes data analysis using Excel .
I entered the following formula to classify the result of calcium but Excel would not accept it and tells me it is text and should start it with “=” sign.,
The formula is:
=IF(H10<2.2),”Low”),IF(H10=>2.2,H10=<2.55),””,IF(H1>2.55,H10=<2.61975),”Mild Hypercalcemia”,IF(H10=<3.46905,”Moderate Hypercalcemia”,IF(H10>3.46705,”HYPERCALCEMIC CRISES”,””))))
Can anybody help.
Sincere thanks in advance
Ibrahim
I am establishing a blood electrolytes data analysis using Excel .I entered the following formula to classify the result of calcium but Excel would not accept it and tells me it is text and should start it with “=” sign.,The formula is: =IF(H10<2.2),”Low”),IF(H10=>2.2,H10=<2.55),””,IF(H1>2.55,H10=<2.61975),”Mild Hypercalcemia”,IF(H10=<3.46905,”Moderate Hypercalcemia”,IF(H10>3.46705,”HYPERCALCEMIC CRISES”,””)))) Can anybody help.Sincere thanks in advanceIbrahim Read More
Announcing the Public Preview of Standby Pools for Virtual Machine Scale Sets
We recently announced the public preview of Standby Pools for Virtual Machine Scale Sets with Flexible Orchestration. Standby Pools is a new service that enables you to increase your scaling performance by creating a pool of pre-provisioned virtual machines from which your scale can pull from when scaling out.
Standby pools reduce the time to scale out by performing various initialization steps such as installing applications/ software or loading substantial amounts of data. These initialization steps are performed on the virtual machines in the standby pool before to being moved into the scale set.
There is more to quickly scaling out than simply receiving a virtual machine. Standby pools are designed for customers not only looking to get a VM as quickly as possible, but also for the customers who need the time to get their VM setup and configured before it receives any work.
With Standby Pools, all the work you normally would do after receiving a virtual machine can be completed in the pool. This helps ensure the VMs in your scale set are the ones handling the work while your pooled VMs are ready at a moment’s notice.
When it is time to scale up, any scale up event will automatically pull a VM from the pool. If your VM is in a running state, it is immediately ready for work. If you are using deallocated VMs to save costs, we automatically move the VM from the pool into the scale set and start it. With deallocated VMs, the only latency you experience is from the time the VM is shutdown to when it is running. There is no additional waiting for your application to install or running scripts to download binaries. These steps were already done in the pool.
When it comes time to scale your scale set back down, the pool will automatically refill to maintain the maxReadyCapacity configured. This ensures that you always maintain a safe balance of VMs in your scale set and VMs in your standby pool.
Key Benefits
Saving time by completing post provisioning steps in the pool before instances are moved into the scale set
Increase scaling performance
Save costs by utilizing deallocated virtual machines
Maintain a safety net of VMs ready to scale out at any time.
The standby pool scales up and down automatically based on your scale set capacity
Customers of Standby Pools
Large and small enterprises who need to quickly scale their workloads and who have long post provisioning steps.
Organizations who require a low latency and cost-effective scaling solution.
Customers wanting to optimize their deployments for random bursts of incoming traffic.
Adding a Standby Pool
Adding a Standby Pool to a new Virtual Machine Scale Set or an existing one is simple and can be done via the Azure Portal or your favorite SDK such as .NET, Java, PowerShell, CLI, and more.
To add a Standby Pool to an existing scale set using the Azure Portal, navigate to your Virtual Machine Scale Set and under Availability + scale, select Standby Pool. Then select Manage pool and provide a name, provisioning state and maximum ready capacity.
Save the changes and your pool will automatically start filling. Any future scale out events will automatically use instances from your Standby Pool.
If at any point you want to adjust the size or provisioning state of your pool, simply navigate back to the Standby Pool blade, select Manage pool and adjust the settings.
The pool will automatically adjust to meet the new configuration settings.
Available Now
Standby Pools are available in all public cloud regions. To get started using Standby Pools, see Standby Pools for Virtual Machine Scale Sets on Microsoft Learn.
Micah McKittrick
Microsoft Azure Compute Services
Senior Product Manager
Microsoft Tech Community – Latest Blogs –Read More
Plot legend with 2-d layout
Is it possible to do four (or more) plots using hold on and then create a legend that has a 2-d layout like this?Is it possible to do four (or more) plots using hold on and then create a legend that has a 2-d layout like this? Is it possible to do four (or more) plots using hold on and then create a legend that has a 2-d layout like this? plot, legend MATLAB Answers — New Questions
Request for Simulink to provide link to offending block for “the model, ‘xxxx’, was changed after the SimState was saved”
This request refers to the three questions:
https://uk.mathworks.com/matlabcentral/answers/1736580-cannot-find-state-n-in-the-given-variable-error-when-trying-to-start-a-simulation-using-previous?s_tid=prof_contriblnk
https://uk.mathworks.com/matlabcentral/answers/182251-simulink-cannot-load-the-initial-simstate?s_tid=srchtitle
https://uk.mathworks.com/matlabcentral/answers/38166-simstate-error?s_tid=srchtitle
In all these examples, users (including me) are struggling because we are trying to use the "Save Operating Point" method.
The "Save Operating Point" method is extremely powerful, and a very useful feature of Simulink that we would like to exploit to its fullest extent.
However, as users find, it is extremely easy to encounter the following error, when trying to run the simulation using the "Saved Operating Point":
"Simulink cannot load the initial SimState because the model, ‘xxxx’, was changed after the SimState was saved. Run the simulation again and resave the SimState.
This is problematic when the model is very large, as the search space (number of subsystems and parameters) is huge. Finding the problem block/parameter is like looking for a needle in a haystack.
Often everything is PERFECT, except for perhaps one single parameterised block that is causing the issue. For the user to find this, without a hint from Simulink about where to start looking, is very difficult.
Simulink must KNOW where the new model is different to that in the saved states, because it is detecting that place and throwing the error.
Please could Simulink then tell the user WHICH block/parameter the problem is with?
Even just the FIRST block/parameter problem would be a help, because often there may be only one.
A link could be provided to the relevant block/parameter, or even just the text listing the block pathname.
Ideally a list of the problem blocks/parameters could be provided, if there are more than one.
Please can this be included in future Simulink versions?This request refers to the three questions:
https://uk.mathworks.com/matlabcentral/answers/1736580-cannot-find-state-n-in-the-given-variable-error-when-trying-to-start-a-simulation-using-previous?s_tid=prof_contriblnk
https://uk.mathworks.com/matlabcentral/answers/182251-simulink-cannot-load-the-initial-simstate?s_tid=srchtitle
https://uk.mathworks.com/matlabcentral/answers/38166-simstate-error?s_tid=srchtitle
In all these examples, users (including me) are struggling because we are trying to use the "Save Operating Point" method.
The "Save Operating Point" method is extremely powerful, and a very useful feature of Simulink that we would like to exploit to its fullest extent.
However, as users find, it is extremely easy to encounter the following error, when trying to run the simulation using the "Saved Operating Point":
"Simulink cannot load the initial SimState because the model, ‘xxxx’, was changed after the SimState was saved. Run the simulation again and resave the SimState.
This is problematic when the model is very large, as the search space (number of subsystems and parameters) is huge. Finding the problem block/parameter is like looking for a needle in a haystack.
Often everything is PERFECT, except for perhaps one single parameterised block that is causing the issue. For the user to find this, without a hint from Simulink about where to start looking, is very difficult.
Simulink must KNOW where the new model is different to that in the saved states, because it is detecting that place and throwing the error.
Please could Simulink then tell the user WHICH block/parameter the problem is with?
Even just the FIRST block/parameter problem would be a help, because often there may be only one.
A link could be provided to the relevant block/parameter, or even just the text listing the block pathname.
Ideally a list of the problem blocks/parameters could be provided, if there are more than one.
Please can this be included in future Simulink versions? This request refers to the three questions:
https://uk.mathworks.com/matlabcentral/answers/1736580-cannot-find-state-n-in-the-given-variable-error-when-trying-to-start-a-simulation-using-previous?s_tid=prof_contriblnk
https://uk.mathworks.com/matlabcentral/answers/182251-simulink-cannot-load-the-initial-simstate?s_tid=srchtitle
https://uk.mathworks.com/matlabcentral/answers/38166-simstate-error?s_tid=srchtitle
In all these examples, users (including me) are struggling because we are trying to use the "Save Operating Point" method.
The "Save Operating Point" method is extremely powerful, and a very useful feature of Simulink that we would like to exploit to its fullest extent.
However, as users find, it is extremely easy to encounter the following error, when trying to run the simulation using the "Saved Operating Point":
"Simulink cannot load the initial SimState because the model, ‘xxxx’, was changed after the SimState was saved. Run the simulation again and resave the SimState.
This is problematic when the model is very large, as the search space (number of subsystems and parameters) is huge. Finding the problem block/parameter is like looking for a needle in a haystack.
Often everything is PERFECT, except for perhaps one single parameterised block that is causing the issue. For the user to find this, without a hint from Simulink about where to start looking, is very difficult.
Simulink must KNOW where the new model is different to that in the saved states, because it is detecting that place and throwing the error.
Please could Simulink then tell the user WHICH block/parameter the problem is with?
Even just the FIRST block/parameter problem would be a help, because often there may be only one.
A link could be provided to the relevant block/parameter, or even just the text listing the block pathname.
Ideally a list of the problem blocks/parameters could be provided, if there are more than one.
Please can this be included in future Simulink versions? operating point, initial simstate MATLAB Answers — New Questions
Compute the basin of attraction for a steady state of an ordinary differential equation ODE
I need write a function called "compute_basin" that takes in a steady state and its k value and computes which set of initial conditions in [15,30] approach that steady state. Specifically it will return two values, "a" and "b", which describe the set [a,b] of initial conditions that approach the steady state. The function will be assessed by running
[a,b]=compute_basin(steady_state,k);
for many different values of k and the associated steady states.
Inputs:
a scalar value of a steady state
a scalar value of k (note the steady state should be correct for the k value)
Outputs:
a scalar for the lower bounds of the basin of attraction
a scalar for the upper bounds for the basin of attraction
This is what i have so far:
function [a, b] = compute_basin(Ceq, k)
% Initialize variables
a = 15; % Lower bound for the basin of attraction
b = 30; % Upper bound for the basin of attraction
threshold = 0.001; % Error threshold
% Binary search for the lower bound (a)
left = 15;
right = 30;
while left < right
mid = (left + right) / 2;
tstar = compute_time_to_steady(mid, k, Ceq);
if tstar > 0
right = mid;
else
left = mid + 0.1;
end
end
a = left;
% Binary search for the upper bound (b)
left = 15;
right = 30;
while left < right
mid = (left + right) / 2;
tstar = compute_time_to_steady(mid, k, Ceq);
if tstar > 0
left = mid;
else
right = mid – 0.1;
end
end
b = right;
end
But unfortunalty this is not correct. I have a tip saying that "There are many ways of doing this but a binary search algorithm might be helpful (Wikipedia entry for binary searchLinks to an external site.). Make sure that the [a,b] bounds are within the range of [15,30]. Note that some steady states may be unstable and so their basin of attraction will only be their exact value. In these cases a=b. It helps to solve for the upper and lower bounds separately, i.e. running the code for a and then running it again for b."
I have acces to three functions, the first is "compute_ode" that computes the derivative dC/dt for the differential equation model dcdt = 0.1 * (c-20) * (23-c) * (c-26) + k.
function dcdt = compute_ode(t,c,k)
% write the equation for the differential equation and assign it to output dcdt
dcdt = 0.1 * (c-20) * (23-c) * (c-26) + k;
end
Then i have the second "compute_states" that takes as input a value for k and then returns as output all real-valued steady states for the differential equation.
function vectCeq = compute_states(k)
% Coefficients of the polynomial equation -0.1*c^3 + 6.9*c^2 – 157.8*c + 1196 + k = 0
coeffs = [-0.1, 6.9, -157.8, 1196 + k];
% Find all roots of the polynomial
all_roots = roots(coeffs);
% Filter out complex roots
real_roots = all_roots(imag(all_roots) == 0);
% Return the real-valued steady states
vectCeq = real_roots;
end
And latsly, I have "compute_time_to_steady" that solves the differential equation and returns the earliest time it takes to get within 1% error of the steady state value:
function tstar = compute_time_to_steady(init_cond, k, steady_state)
% Set the options for the ODE solver
options = odeset(‘RelTol’, 1e-6, ‘AbsTol’, 1e-9);
% Define the ODE function as a nested function
function dcdt = ode_function(t, c)
dcdt = compute_ode(t, c, k);
end
% Initialize variables
tspan = [0 100000]; % Time range from 0 to 100,000
threshold = 0.001; % 1% error threshold
% Solve the ODE
[T, C] = ode45(@ode_function, tspan, init_cond, options);
% Iterate over the solution to find the first time it meets the criterion
for i = 1:length(T)
if abs(C(i) – steady_state) / steady_state < threshold
tstar = T(i);
return;
end
end
% If the criterion is not met within the time range, return the last time point
tstar = T(end);
end
function dcdt = compute_ode(t, c, k)
dcdt = 0.1 * (c – 20) * (23 – c) * (c – 26) + k;
end
function steady_states = compute_states(k)
% Define the steady state values based on the value of k
steady_states = [20; 23; 26];
end
I would really appriciate any help on computing the basin of attraction for a steady state!
Thank you!I need write a function called "compute_basin" that takes in a steady state and its k value and computes which set of initial conditions in [15,30] approach that steady state. Specifically it will return two values, "a" and "b", which describe the set [a,b] of initial conditions that approach the steady state. The function will be assessed by running
[a,b]=compute_basin(steady_state,k);
for many different values of k and the associated steady states.
Inputs:
a scalar value of a steady state
a scalar value of k (note the steady state should be correct for the k value)
Outputs:
a scalar for the lower bounds of the basin of attraction
a scalar for the upper bounds for the basin of attraction
This is what i have so far:
function [a, b] = compute_basin(Ceq, k)
% Initialize variables
a = 15; % Lower bound for the basin of attraction
b = 30; % Upper bound for the basin of attraction
threshold = 0.001; % Error threshold
% Binary search for the lower bound (a)
left = 15;
right = 30;
while left < right
mid = (left + right) / 2;
tstar = compute_time_to_steady(mid, k, Ceq);
if tstar > 0
right = mid;
else
left = mid + 0.1;
end
end
a = left;
% Binary search for the upper bound (b)
left = 15;
right = 30;
while left < right
mid = (left + right) / 2;
tstar = compute_time_to_steady(mid, k, Ceq);
if tstar > 0
left = mid;
else
right = mid – 0.1;
end
end
b = right;
end
But unfortunalty this is not correct. I have a tip saying that "There are many ways of doing this but a binary search algorithm might be helpful (Wikipedia entry for binary searchLinks to an external site.). Make sure that the [a,b] bounds are within the range of [15,30]. Note that some steady states may be unstable and so their basin of attraction will only be their exact value. In these cases a=b. It helps to solve for the upper and lower bounds separately, i.e. running the code for a and then running it again for b."
I have acces to three functions, the first is "compute_ode" that computes the derivative dC/dt for the differential equation model dcdt = 0.1 * (c-20) * (23-c) * (c-26) + k.
function dcdt = compute_ode(t,c,k)
% write the equation for the differential equation and assign it to output dcdt
dcdt = 0.1 * (c-20) * (23-c) * (c-26) + k;
end
Then i have the second "compute_states" that takes as input a value for k and then returns as output all real-valued steady states for the differential equation.
function vectCeq = compute_states(k)
% Coefficients of the polynomial equation -0.1*c^3 + 6.9*c^2 – 157.8*c + 1196 + k = 0
coeffs = [-0.1, 6.9, -157.8, 1196 + k];
% Find all roots of the polynomial
all_roots = roots(coeffs);
% Filter out complex roots
real_roots = all_roots(imag(all_roots) == 0);
% Return the real-valued steady states
vectCeq = real_roots;
end
And latsly, I have "compute_time_to_steady" that solves the differential equation and returns the earliest time it takes to get within 1% error of the steady state value:
function tstar = compute_time_to_steady(init_cond, k, steady_state)
% Set the options for the ODE solver
options = odeset(‘RelTol’, 1e-6, ‘AbsTol’, 1e-9);
% Define the ODE function as a nested function
function dcdt = ode_function(t, c)
dcdt = compute_ode(t, c, k);
end
% Initialize variables
tspan = [0 100000]; % Time range from 0 to 100,000
threshold = 0.001; % 1% error threshold
% Solve the ODE
[T, C] = ode45(@ode_function, tspan, init_cond, options);
% Iterate over the solution to find the first time it meets the criterion
for i = 1:length(T)
if abs(C(i) – steady_state) / steady_state < threshold
tstar = T(i);
return;
end
end
% If the criterion is not met within the time range, return the last time point
tstar = T(end);
end
function dcdt = compute_ode(t, c, k)
dcdt = 0.1 * (c – 20) * (23 – c) * (c – 26) + k;
end
function steady_states = compute_states(k)
% Define the steady state values based on the value of k
steady_states = [20; 23; 26];
end
I would really appriciate any help on computing the basin of attraction for a steady state!
Thank you! I need write a function called "compute_basin" that takes in a steady state and its k value and computes which set of initial conditions in [15,30] approach that steady state. Specifically it will return two values, "a" and "b", which describe the set [a,b] of initial conditions that approach the steady state. The function will be assessed by running
[a,b]=compute_basin(steady_state,k);
for many different values of k and the associated steady states.
Inputs:
a scalar value of a steady state
a scalar value of k (note the steady state should be correct for the k value)
Outputs:
a scalar for the lower bounds of the basin of attraction
a scalar for the upper bounds for the basin of attraction
This is what i have so far:
function [a, b] = compute_basin(Ceq, k)
% Initialize variables
a = 15; % Lower bound for the basin of attraction
b = 30; % Upper bound for the basin of attraction
threshold = 0.001; % Error threshold
% Binary search for the lower bound (a)
left = 15;
right = 30;
while left < right
mid = (left + right) / 2;
tstar = compute_time_to_steady(mid, k, Ceq);
if tstar > 0
right = mid;
else
left = mid + 0.1;
end
end
a = left;
% Binary search for the upper bound (b)
left = 15;
right = 30;
while left < right
mid = (left + right) / 2;
tstar = compute_time_to_steady(mid, k, Ceq);
if tstar > 0
left = mid;
else
right = mid – 0.1;
end
end
b = right;
end
But unfortunalty this is not correct. I have a tip saying that "There are many ways of doing this but a binary search algorithm might be helpful (Wikipedia entry for binary searchLinks to an external site.). Make sure that the [a,b] bounds are within the range of [15,30]. Note that some steady states may be unstable and so their basin of attraction will only be their exact value. In these cases a=b. It helps to solve for the upper and lower bounds separately, i.e. running the code for a and then running it again for b."
I have acces to three functions, the first is "compute_ode" that computes the derivative dC/dt for the differential equation model dcdt = 0.1 * (c-20) * (23-c) * (c-26) + k.
function dcdt = compute_ode(t,c,k)
% write the equation for the differential equation and assign it to output dcdt
dcdt = 0.1 * (c-20) * (23-c) * (c-26) + k;
end
Then i have the second "compute_states" that takes as input a value for k and then returns as output all real-valued steady states for the differential equation.
function vectCeq = compute_states(k)
% Coefficients of the polynomial equation -0.1*c^3 + 6.9*c^2 – 157.8*c + 1196 + k = 0
coeffs = [-0.1, 6.9, -157.8, 1196 + k];
% Find all roots of the polynomial
all_roots = roots(coeffs);
% Filter out complex roots
real_roots = all_roots(imag(all_roots) == 0);
% Return the real-valued steady states
vectCeq = real_roots;
end
And latsly, I have "compute_time_to_steady" that solves the differential equation and returns the earliest time it takes to get within 1% error of the steady state value:
function tstar = compute_time_to_steady(init_cond, k, steady_state)
% Set the options for the ODE solver
options = odeset(‘RelTol’, 1e-6, ‘AbsTol’, 1e-9);
% Define the ODE function as a nested function
function dcdt = ode_function(t, c)
dcdt = compute_ode(t, c, k);
end
% Initialize variables
tspan = [0 100000]; % Time range from 0 to 100,000
threshold = 0.001; % 1% error threshold
% Solve the ODE
[T, C] = ode45(@ode_function, tspan, init_cond, options);
% Iterate over the solution to find the first time it meets the criterion
for i = 1:length(T)
if abs(C(i) – steady_state) / steady_state < threshold
tstar = T(i);
return;
end
end
% If the criterion is not met within the time range, return the last time point
tstar = T(end);
end
function dcdt = compute_ode(t, c, k)
dcdt = 0.1 * (c – 20) * (23 – c) * (c – 26) + k;
end
function steady_states = compute_states(k)
% Define the steady state values based on the value of k
steady_states = [20; 23; 26];
end
I would really appriciate any help on computing the basin of attraction for a steady state!
Thank you! basin, ode, ode45, differential equations MATLAB Answers — New Questions
Dev Channel update to 126.0.2592.11 is live.
Hello Insiders! We released 126.0.2592.11 to the Dev channel! This includes numerous fixes. For more details on the changes, check out the highlights below.
Microsoft Rewards: More Ways to Earn, Redeem, and Protect Your Points | Bing Search Blog
Added Features:
Introduced a toggle for One-Time Password (OTP) within the edge://flags settings on Android.
Improved Reliability:
Fixed an issue that caused the browser to crash when the ‘Join now and activate cash back’ button was clicked again after signing into the MSA account.
Resolved a problem that caused unexpected crashes during the capture of toolbar snapshots.
Changed Behavior:
Resolved an issue when using Narrator within the pane indicating ‘This page is open in Internet Explorer mode,’ the Narrator’s focus would incorrectly land on the ‘Learn more’ link twice without providing any audio feedback.
Resolved a problem where the focus sequence was not in proper order when selecting the ‘Manage Performance Settings’ menu option.
Fixed an issue where a favorites folder required a double-click to open after being renamed.
Resolved an issue that caused app icons to not appear when the Sidebar settings page was refreshed.
Resolved a problem that caused the display of an incorrect favicon.
Resolved a problem that prevented tab groups opened from separate profiles from being displayed collectively.
Resolved a problem where the ‘Delete site’ message was overlapping with other options in the edge://settings/starthomeNTP section.
Fixed an issue where pressing Enter on the Back button resulted in no response within the Microsoft Rewards section.
Android:
Fixed an issue where rapidly clicking on ‘Set as default browser’ would inadvertently open two separate windows.
Fixed an issue where the word ‘Active’ was partially hidden on the history page on android.
Resolved a problem where there were some inconsistencies in the UI colors within the favorites section.
See an issue that you think might be a bug? Remember to send that directly through the in-app feedback by heading to the … menu > Help and feedback > Send feedback and include diagnostics so the team can investigate.
Thanks again for sending us feedback and helping us improve our Insider builds.
~Gouri
Hello Insiders! We released 126.0.2592.11 to the Dev channel! This includes numerous fixes. For more details on the changes, check out the highlights below.
Microsoft Rewards: More Ways to Earn, Redeem, and Protect Your Points | Bing Search Blog
Added Features:
Introduced a toggle for One-Time Password (OTP) within the edge://flags settings on Android.
Improved Reliability:
Fixed an issue that caused the browser to crash when the ‘Join now and activate cash back’ button was clicked again after signing into the MSA account.
Resolved a problem that caused unexpected crashes during the capture of toolbar snapshots.
Changed Behavior:
Resolved an issue when using Narrator within the pane indicating ‘This page is open in Internet Explorer mode,’ the Narrator’s focus would incorrectly land on the ‘Learn more’ link twice without providing any audio feedback.
Resolved a problem where the focus sequence was not in proper order when selecting the ‘Manage Performance Settings’ menu option.
Fixed an issue where a favorites folder required a double-click to open after being renamed.
Resolved an issue that caused app icons to not appear when the Sidebar settings page was refreshed.
Resolved a problem that caused the display of an incorrect favicon.
Resolved a problem that prevented tab groups opened from separate profiles from being displayed collectively.
Resolved a problem where the ‘Delete site’ message was overlapping with other options in the edge://settings/starthomeNTP section.
Fixed an issue where pressing Enter on the Back button resulted in no response within the Microsoft Rewards section.
Android:
Fixed an issue where rapidly clicking on ‘Set as default browser’ would inadvertently open two separate windows.
Fixed an issue where the word ‘Active’ was partially hidden on the history page on android.
Resolved a problem where there were some inconsistencies in the UI colors within the favorites section.
See an issue that you think might be a bug? Remember to send that directly through the in-app feedback by heading to the … menu > Help and feedback > Send feedback and include diagnostics so the team can investigate.
Thanks again for sending us feedback and helping us improve our Insider builds.
~Gouri Read More
How do I repeat the same formula over multiple rows?
Each row in my table represents a separate grouping of cards, the numbers indicate which card is present in the grouping (e.g. 1= Card 1). I need to figure out how to check if two cards are present in the same group, and then repeat that formula across each row, to check how many rows/groups contain the same two cards. For example, in the screenshot I am checking if row/group 2 contains both 8 and 15. I can’t figure out how to repeat this formula across each row in the data table to give me the total count of card pairings, in this case the total number of rows/groups where both 8 and 15 are present in the same row/group. Can anyone help me figure this out?
Each row in my table represents a separate grouping of cards, the numbers indicate which card is present in the grouping (e.g. 1= Card 1). I need to figure out how to check if two cards are present in the same group, and then repeat that formula across each row, to check how many rows/groups contain the same two cards. For example, in the screenshot I am checking if row/group 2 contains both 8 and 15. I can’t figure out how to repeat this formula across each row in the data table to give me the total count of card pairings, in this case the total number of rows/groups where both 8 and 15 are present in the same row/group. Can anyone help me figure this out? Read More
Copilot doesn’t index documents of another org in the company
Issue is that I want to use copilot for the same functionality of sharepoint.
Before I start working on a slide deck, for story telling, I’m checking if there is already work done on that topic. And if so, can I repurpose those slides?
Copilot does not index documents other than the professionals in your hierarchy tree.
Issue is that I want to use copilot for the same functionality of sharepoint. Before I start working on a slide deck, for story telling, I’m checking if there is already work done on that topic. And if so, can I repurpose those slides? Copilot does not index documents other than the professionals in your hierarchy tree. Read More
Occaisional Issue with Outlook Attachment Preview Not Displaying
One of our users is frequently experiencing Outlook failing to display the attachment preview. Roughly 15-30% of the time a blank pane is displayed when that attachment preview is invoked. Sometimes that same message / attachment combo could be selected within a few minutes of each other – the first time it might not work, while the next time it could well display correctly. This began ~3 weeks ago, and we have been unable to discover anything that had changed to cause this. Has anyone experienced something similar, or have a suggestion as to what could be causing this issue?
One of our users is frequently experiencing Outlook failing to display the attachment preview. Roughly 15-30% of the time a blank pane is displayed when that attachment preview is invoked. Sometimes that same message / attachment combo could be selected within a few minutes of each other – the first time it might not work, while the next time it could well display correctly. This began ~3 weeks ago, and we have been unable to discover anything that had changed to cause this. Has anyone experienced something similar, or have a suggestion as to what could be causing this issue? Read More
Help with my xlookup partial match formula
I have a list of clients from one database whose names need to be updated in another database to match, and their names are just slightly different from one another. I’ve been trying to run an xlookup partial match to search for an approximate match, but it’s not really working. Is there a formula to solve for something like this?
Example: the Company name in the database that needs to be updated is “AGK MCD#19542”, and the name it should match is “AGK MCD 19542”. Another example, the name that needs to be updated is in the system as “MCD#14114 (AGK)” and the name it should match is “AGK MCD 14114”.
My formula is as follows: =XLOOKUP(“*”&D16&”*”,’HubSpot Companies’!$B$2:$B$7320,’HubSpot Companies’!$A$2:$A$7320,”not found”,2)
So for example, the value in D16 is AGK MCD 19542, and the value within the lookup array that it should match to is AGK MCD#19542, but with the formula written as is, it’s returning ‘not found’.
The lookup array values and the lookup values do mostly have store numbers that match one another; is there a way to search only on the number and not the rest of the cell text? This is a list of over 800 companies so if we can find a formula to do it that would be amazing.
I have a list of clients from one database whose names need to be updated in another database to match, and their names are just slightly different from one another. I’ve been trying to run an xlookup partial match to search for an approximate match, but it’s not really working. Is there a formula to solve for something like this? Example: the Company name in the database that needs to be updated is “AGK MCD#19542”, and the name it should match is “AGK MCD 19542”. Another example, the name that needs to be updated is in the system as “MCD#14114 (AGK)” and the name it should match is “AGK MCD 14114”. My formula is as follows: =XLOOKUP(“*”&D16&”*”,’HubSpot Companies’!$B$2:$B$7320,’HubSpot Companies’!$A$2:$A$7320,”not found”,2) So for example, the value in D16 is AGK MCD 19542, and the value within the lookup array that it should match to is AGK MCD#19542, but with the formula written as is, it’s returning ‘not found’. The lookup array values and the lookup values do mostly have store numbers that match one another; is there a way to search only on the number and not the rest of the cell text? This is a list of over 800 companies so if we can find a formula to do it that would be amazing. Read More
GenAI Gateway Accelerator
Every app will be reinvented with Generative AI and new apps will be built that weren’t possible before. Generative AI helps to build intelligent apps using the Large Language Model (LLM) capabilities. As the number of intelligent applications grows alongside the adoption of various large language models (LLMs), enterprises encounter significant challenges in efficiently federating and managing generative AI resources. Key issues include ensuring resiliency and high availability of models, tracking model usage and implementing chargeback mechanisms for users, managing increased latency, and addressing data sovereignty concerns. This demands for a centralized solution “Gen AI Gateway” that must seamlessly integrate, optimize, and distribute the workloads across a federated network of GenAI resources.
This blog post provides an overview of how Azure APIM Management can be used as a GenAI Gateway leveraging the new accelerator scenario named “GenAI Gateway Accelerator” published on the APIM Landing Zone Accelerator.
GenAI Gateway
LLMs are accessible via their rest endpoints. Typically, large enterprises hide these endpoints behind a secure gateway providing centralized access over resources.
Azure API Management is a globally available and proven API management solution, which allows organizations to abstract, secure, observe, and publish APIs. APIM’s gateway component is used to create the GenAI Gateway that can serve as an intelligent interface/middleware that dynamically balances incoming traffic across backend resources to achieve optimizing resource utilization. In addition to load balancing, GenAI Gateway can be equipped with extra capabilities to address the challenges around billing, monitoring etc.
Key benefits from GenAI Gateway
APIM Landing Zone Accelerator
Azure API Management (APIM) Landing Zone Accelerator (LZA) offers comprehensive guidance including reference architecture and implementation strategies. It also provides design guidance, recommendations and considerations on key areas critical to provisioning APIM with a secure baseline. These guidance and reference implementation are aligned with industry proven practices, such as those presented in Azure Landing Zones guidance in the Cloud Adoption Framework.
APIM LZA follows a layered approach provisioning APIM in a secure baseline as the base layer, on top of which backends such as Azure OpenAI, App Service, Azure Container Apps, etc., can be deployed.
Azure API Management – GenAI Backend
The new GenAI scenario demonstrates how to provision and interact with Generative AI resources through API Management. The capabilities below are handled by the accelerator:
Capability
Description
Load balance traffic across PAYG endpoints using simple and weighted round-robin algorithm.
Manage spikes in traffic by routing traffic to PAYG endpoints when a PTU is out of capacity.
Dynamically adjust rate-limits applied to different workloads
Record the token consumption for usage tracking and attribution
Reference Architecture
The below reference architecture illustrates APIM provisioned in a secure baseline, fronted by an Application Gateway. It includes private deployments of Azure OpenAI endpoints, and the policies specifically tailored for GenAI use cases. All the components are secured with Network Security Groups and supporting services such as Event Hub, Key Vault are accessed through private endpoints ensuring a robust and secure infrastructure.
Deployment
You can deploy the Bicep based deployment as below
Deploy Azure API Management – Secure Baseline scenario.
Run the following command to deploy the scenarios
./scripts/deploy-workload-genai.sh
Supported Regions
Some of the new Azure OpenAI policies are not available in all the regions yet. If you see the deployment failures, try choosing a different region. The following regions are more likely to work.
australiacentral, australiaeast, australiasoutheast, brazilsouth, eastasia, francecentral, germanywestcentral, koreacentral, northeurope, southeastasia, southcentralus, uksouth, ukwest, westeurope, westus2, westus3
Test/Demo setup
If you are looking for a quick way to test or demo these capabilities with a minimalistic non – production like APIM setup against an Azure OpenAI simulator, check out this repository.
:play_button: GenAI Gateway Test Toolkit
AI Hub Gateway capabilities
Looking for a comprehensive reference implementation to provision your AI Hub Gateway? Check out AI Hub Gateway scenario.
:play_button:AI Hub Gateway
Resources
https://aka.ms/apim-genai-lza
Designing and implementing a gateway solution with Azure OpenAI resources | Microsoft Learn
Special thanks to the APIM Landing Zone Accelerator team Andrei Kamenev, Ben Briggs, Srini Padala, Prasanna Nagarajan, Vivek Soni, Lucas Huet, Stuart Leeks, Mohammed Saif for their contribution to launch the new GenAI Gateway Accelerator scenario.
Microsoft Tech Community – Latest Blogs –Read More
Matlab Grader not working when restore a Moodle course between sites
I have two different Moodle sites A and B (last update for LTS 4.1.x) with Matlab Grader working on both systems (a different deployment for each one).
Steps:
Create a Matlab Grader activity in a course in site A
Backup course in site A
Restore course in site B
Launch Matlab Grader activity in the new course at site B -> blank page.
Create and launch a new Matlab Grader activity in the same course at site B -> works OK.
Am I missing something I need to do on the restored course at site B for the Matlab Grader to work?
Thanks.I have two different Moodle sites A and B (last update for LTS 4.1.x) with Matlab Grader working on both systems (a different deployment for each one).
Steps:
Create a Matlab Grader activity in a course in site A
Backup course in site A
Restore course in site B
Launch Matlab Grader activity in the new course at site B -> blank page.
Create and launch a new Matlab Grader activity in the same course at site B -> works OK.
Am I missing something I need to do on the restored course at site B for the Matlab Grader to work?
Thanks. I have two different Moodle sites A and B (last update for LTS 4.1.x) with Matlab Grader working on both systems (a different deployment for each one).
Steps:
Create a Matlab Grader activity in a course in site A
Backup course in site A
Restore course in site B
Launch Matlab Grader activity in the new course at site B -> blank page.
Create and launch a new Matlab Grader activity in the same course at site B -> works OK.
Am I missing something I need to do on the restored course at site B for the Matlab Grader to work?
Thanks. matlab grader, backup, restore, moodle MATLAB Answers — New Questions
Visibility of Custom Library in Simulink
Hello everybody,
i´m having following problem with the custom library:
According to the site mentioned later i created a custom library with several blocks. Saving the custom library on a path iny my Matlab-Folder (not the Installation Folder) leads to the problem, that i can just access the library while the concerning folder is active in Simulink. Having a project in a different folder disables the accessibility. I also tried to create the custom library as a project and add this as a referenced project to the main project – but still it doesnt work.
My goal is to built up a bigger custom library with sub-libs, to which different projects (created by different persons) get access to. Of course there is the possibility of copying the needed sub-libs to the concerning projects. But by updating several blocks, the changes would need to be adjusted manually in existing projects (recopying the sub-lib), which use those blocks.
I hope i could explain my problem adequate
https://de.mathworks.com/help/simulink/ug/adding-libraries-to-the-library-browser.htmlHello everybody,
i´m having following problem with the custom library:
According to the site mentioned later i created a custom library with several blocks. Saving the custom library on a path iny my Matlab-Folder (not the Installation Folder) leads to the problem, that i can just access the library while the concerning folder is active in Simulink. Having a project in a different folder disables the accessibility. I also tried to create the custom library as a project and add this as a referenced project to the main project – but still it doesnt work.
My goal is to built up a bigger custom library with sub-libs, to which different projects (created by different persons) get access to. Of course there is the possibility of copying the needed sub-libs to the concerning projects. But by updating several blocks, the changes would need to be adjusted manually in existing projects (recopying the sub-lib), which use those blocks.
I hope i could explain my problem adequate
https://de.mathworks.com/help/simulink/ug/adding-libraries-to-the-library-browser.html Hello everybody,
i´m having following problem with the custom library:
According to the site mentioned later i created a custom library with several blocks. Saving the custom library on a path iny my Matlab-Folder (not the Installation Folder) leads to the problem, that i can just access the library while the concerning folder is active in Simulink. Having a project in a different folder disables the accessibility. I also tried to create the custom library as a project and add this as a referenced project to the main project – but still it doesnt work.
My goal is to built up a bigger custom library with sub-libs, to which different projects (created by different persons) get access to. Of course there is the possibility of copying the needed sub-libs to the concerning projects. But by updating several blocks, the changes would need to be adjusted manually in existing projects (recopying the sub-lib), which use those blocks.
I hope i could explain my problem adequate
https://de.mathworks.com/help/simulink/ug/adding-libraries-to-the-library-browser.html custom library MATLAB Answers — New Questions
MATLAB Visualizations broken?
Hello,
can anyone please check, if the MATLAB Visualizations are right now offline for everyone or just for me? I’ve made 2 visualizations and both show the "broken image" icon instead of the graph.
The problem occurred half an hour ago or so – I do not know exactly. As you can see, widgets are not affected. Both visualizations are public and can be "Save an Run" with "MATLAB code ran successfully." as status.
Here is one of the MATLAB codes that has worked flawless till it stopped:
% Template MATLAB code for visualizing data using the YYAXIS and PLOT functions.
% Prior to running this MATLAB code template, assign the channel variables.
% Set ‘readChannelID’ to the channel ID of the channel to read from.
% Also, assign the read field IDs to the variables ‘fieldID1’, and ‘fieldID2’.
% TODO – Replace the [] with channel ID to read data from:
readChannelID = [********];
% TODO – Replace the [] with the Field ID to read data from:
fieldID1 = [3];
% TODO – Replace the [] with the Field ID to read data from:
fieldID2 = [5];
% Channel Read API Key
% If your channel is private, then enter the read API
% Key between the ” below:
readAPIKey = ‘***********’;
%% Read Data %%
% Read first data variable
[data1, time1] = thingSpeakRead(readChannelID, ‘Field’, fieldID1, ‘NumPoints’, 600, ‘ReadKey’, readAPIKey);
% Read second data variable
[data2, time2] = thingSpeakRead(readChannelID, ‘Field’, fieldID2, ‘NumPoints’, 600, ‘ReadKey’, readAPIKey);
%% Visualize Data %%
yyaxis left;
plot(time1, data1)
xlabel(‘Zeit’);
ylabel(‘Watt’);
yyaxis right;
plot(time2, data2);
xlabel(‘Zeit’);
ylabel(‘Ampere’);
title(‘Phase 2 – Watt & Ampere’);
grid on;
Any help is appreciated – thanks in advance!
MDHello,
can anyone please check, if the MATLAB Visualizations are right now offline for everyone or just for me? I’ve made 2 visualizations and both show the "broken image" icon instead of the graph.
The problem occurred half an hour ago or so – I do not know exactly. As you can see, widgets are not affected. Both visualizations are public and can be "Save an Run" with "MATLAB code ran successfully." as status.
Here is one of the MATLAB codes that has worked flawless till it stopped:
% Template MATLAB code for visualizing data using the YYAXIS and PLOT functions.
% Prior to running this MATLAB code template, assign the channel variables.
% Set ‘readChannelID’ to the channel ID of the channel to read from.
% Also, assign the read field IDs to the variables ‘fieldID1’, and ‘fieldID2’.
% TODO – Replace the [] with channel ID to read data from:
readChannelID = [********];
% TODO – Replace the [] with the Field ID to read data from:
fieldID1 = [3];
% TODO – Replace the [] with the Field ID to read data from:
fieldID2 = [5];
% Channel Read API Key
% If your channel is private, then enter the read API
% Key between the ” below:
readAPIKey = ‘***********’;
%% Read Data %%
% Read first data variable
[data1, time1] = thingSpeakRead(readChannelID, ‘Field’, fieldID1, ‘NumPoints’, 600, ‘ReadKey’, readAPIKey);
% Read second data variable
[data2, time2] = thingSpeakRead(readChannelID, ‘Field’, fieldID2, ‘NumPoints’, 600, ‘ReadKey’, readAPIKey);
%% Visualize Data %%
yyaxis left;
plot(time1, data1)
xlabel(‘Zeit’);
ylabel(‘Watt’);
yyaxis right;
plot(time2, data2);
xlabel(‘Zeit’);
ylabel(‘Ampere’);
title(‘Phase 2 – Watt & Ampere’);
grid on;
Any help is appreciated – thanks in advance!
MD Hello,
can anyone please check, if the MATLAB Visualizations are right now offline for everyone or just for me? I’ve made 2 visualizations and both show the "broken image" icon instead of the graph.
The problem occurred half an hour ago or so – I do not know exactly. As you can see, widgets are not affected. Both visualizations are public and can be "Save an Run" with "MATLAB code ran successfully." as status.
Here is one of the MATLAB codes that has worked flawless till it stopped:
% Template MATLAB code for visualizing data using the YYAXIS and PLOT functions.
% Prior to running this MATLAB code template, assign the channel variables.
% Set ‘readChannelID’ to the channel ID of the channel to read from.
% Also, assign the read field IDs to the variables ‘fieldID1’, and ‘fieldID2’.
% TODO – Replace the [] with channel ID to read data from:
readChannelID = [********];
% TODO – Replace the [] with the Field ID to read data from:
fieldID1 = [3];
% TODO – Replace the [] with the Field ID to read data from:
fieldID2 = [5];
% Channel Read API Key
% If your channel is private, then enter the read API
% Key between the ” below:
readAPIKey = ‘***********’;
%% Read Data %%
% Read first data variable
[data1, time1] = thingSpeakRead(readChannelID, ‘Field’, fieldID1, ‘NumPoints’, 600, ‘ReadKey’, readAPIKey);
% Read second data variable
[data2, time2] = thingSpeakRead(readChannelID, ‘Field’, fieldID2, ‘NumPoints’, 600, ‘ReadKey’, readAPIKey);
%% Visualize Data %%
yyaxis left;
plot(time1, data1)
xlabel(‘Zeit’);
ylabel(‘Watt’);
yyaxis right;
plot(time2, data2);
xlabel(‘Zeit’);
ylabel(‘Ampere’);
title(‘Phase 2 – Watt & Ampere’);
grid on;
Any help is appreciated – thanks in advance!
MD thingspeak, visualizations, matlab MATLAB Answers — New Questions
If I have an array and I need to find an element in the array how do I go about it?
say states,
states = [1 0 0;
1 1 0
0 1 0
0 1 1
0 0 1
1 0 1
1 1 1];
C = 110;
How do I find the index of C in states and call it?
Ideally C is 2 then states(2) will give me 110 what key word can I use? or How do I go about it?say states,
states = [1 0 0;
1 1 0
0 1 0
0 1 1
0 0 1
1 0 1
1 1 1];
C = 110;
How do I find the index of C in states and call it?
Ideally C is 2 then states(2) will give me 110 what key word can I use? or How do I go about it? say states,
states = [1 0 0;
1 1 0
0 1 0
0 1 1
0 0 1
1 0 1
1 1 1];
C = 110;
How do I find the index of C in states and call it?
Ideally C is 2 then states(2) will give me 110 what key word can I use? or How do I go about it? array, index MATLAB Answers — New Questions
Object-Oriented: strange behavior that leads to shared reference
Hi, is my understanding of Matlab OO incorrect or something else is going on here ?
I cannot explain why this code assert :
Given this simple handle class :
classdef TestA < handle
properties
Name string = "default value for TestA";
end
end
An using it like this ( see the explicit size of 1,1 )
classdef TestB < handle
properties
PropA (1,1) TestA % please note the (1,1) size
end
end
An this test usage :
b1 = TestB;
b1.PropA.Name = "in b1 object";
b2 = TestB;
b2.PropA.Name = "in b2 object";
assert(b1.PropA ~= b2.PropA)
This assertion failling clearly state that the PropA property of both objects b1 and b2 is the same object.
Is this a documented behaviour ?
I was expecting to get a new TestA object in every TestB object.
note that we get the same strange behavior with this syntax:
classdef TestB2 < handle
properties
PropA (1,:) TestA = TestA % please note the (1,:) size
end
end
so you get the strange behavior and you loose the (1,1) size constraint.
This can be a workaround, but again, far from clean and still no size constraint
classdef TestB3 < handle
properties
PropA (1,:) TestA = TestA.empty() % please note the (1,:) size
end
methods
function obj = TestB3()
obj.PropA = TestA(); % explicitly create the object works
end
end
end
I can get the size constraint by using a Dependent property but this is so much code for something that basic…
Should i report a bug? or is it explained somewhere in the documentation ?Hi, is my understanding of Matlab OO incorrect or something else is going on here ?
I cannot explain why this code assert :
Given this simple handle class :
classdef TestA < handle
properties
Name string = "default value for TestA";
end
end
An using it like this ( see the explicit size of 1,1 )
classdef TestB < handle
properties
PropA (1,1) TestA % please note the (1,1) size
end
end
An this test usage :
b1 = TestB;
b1.PropA.Name = "in b1 object";
b2 = TestB;
b2.PropA.Name = "in b2 object";
assert(b1.PropA ~= b2.PropA)
This assertion failling clearly state that the PropA property of both objects b1 and b2 is the same object.
Is this a documented behaviour ?
I was expecting to get a new TestA object in every TestB object.
note that we get the same strange behavior with this syntax:
classdef TestB2 < handle
properties
PropA (1,:) TestA = TestA % please note the (1,:) size
end
end
so you get the strange behavior and you loose the (1,1) size constraint.
This can be a workaround, but again, far from clean and still no size constraint
classdef TestB3 < handle
properties
PropA (1,:) TestA = TestA.empty() % please note the (1,:) size
end
methods
function obj = TestB3()
obj.PropA = TestA(); % explicitly create the object works
end
end
end
I can get the size constraint by using a Dependent property but this is so much code for something that basic…
Should i report a bug? or is it explained somewhere in the documentation ? Hi, is my understanding of Matlab OO incorrect or something else is going on here ?
I cannot explain why this code assert :
Given this simple handle class :
classdef TestA < handle
properties
Name string = "default value for TestA";
end
end
An using it like this ( see the explicit size of 1,1 )
classdef TestB < handle
properties
PropA (1,1) TestA % please note the (1,1) size
end
end
An this test usage :
b1 = TestB;
b1.PropA.Name = "in b1 object";
b2 = TestB;
b2.PropA.Name = "in b2 object";
assert(b1.PropA ~= b2.PropA)
This assertion failling clearly state that the PropA property of both objects b1 and b2 is the same object.
Is this a documented behaviour ?
I was expecting to get a new TestA object in every TestB object.
note that we get the same strange behavior with this syntax:
classdef TestB2 < handle
properties
PropA (1,:) TestA = TestA % please note the (1,:) size
end
end
so you get the strange behavior and you loose the (1,1) size constraint.
This can be a workaround, but again, far from clean and still no size constraint
classdef TestB3 < handle
properties
PropA (1,:) TestA = TestA.empty() % please note the (1,:) size
end
methods
function obj = TestB3()
obj.PropA = TestA(); % explicitly create the object works
end
end
end
I can get the size constraint by using a Dependent property but this is so much code for something that basic…
Should i report a bug? or is it explained somewhere in the documentation ? object-oriented MATLAB Answers — New Questions
Teams Mobile – Screen Sharing error only on Android Pixel Phones
Today we noticed that when in a Teams meeting on a Google Pixel phone running the latest Android 14 OS, we are unable to use the Screen Share option in a meeting.
The error message “Action Blocked. This action is not allowed by your organization.” pops up after choosing to screen sharing.
Those with this issue are able to share individual pictures, just not cast their entire screen to Teams.
This led me to believe that one of our application protection policies was blocking this feature from working, but there is no such setting to enable. The closest one is related to screen capture and I have that allowed.
Those with Samsung Android phones with the latest Android OS 14 are successfully able to Screen Share, so its not any policy we have related to android phones.
iPhones are also successfully able to screen share from Teams without any issues.
I did also check our global policy settings for meeting and content sharing is allowed. Content sharing is also allowed for the specific meeting we tested in.
If anyone else has a Google Pixel phone with the latest version of android on it, please let me know if you are experiencing the same problems with sharing your screen in a Teams Meeting.
Today we noticed that when in a Teams meeting on a Google Pixel phone running the latest Android 14 OS, we are unable to use the Screen Share option in a meeting.The error message “Action Blocked. This action is not allowed by your organization.” pops up after choosing to screen sharing.Those with this issue are able to share individual pictures, just not cast their entire screen to Teams.This led me to believe that one of our application protection policies was blocking this feature from working, but there is no such setting to enable. The closest one is related to screen capture and I have that allowed. Those with Samsung Android phones with the latest Android OS 14 are successfully able to Screen Share, so its not any policy we have related to android phones.iPhones are also successfully able to screen share from Teams without any issues. I did also check our global policy settings for meeting and content sharing is allowed. Content sharing is also allowed for the specific meeting we tested in. If anyone else has a Google Pixel phone with the latest version of android on it, please let me know if you are experiencing the same problems with sharing your screen in a Teams Meeting. Read More