Month: August 2024
Viva Amplify From Address
Hi there
I am currently trialling Amplify and am interested to know if it is possible to change the “From” address in publications. If I create a publication it comes from me as an individual but can I make these a Team or a shared mailbox address or a senior leader so the communication doesnt come from me. Hopefully it is an option I skimmed over. Thanks Ben
Hi there I am currently trialling Amplify and am interested to know if it is possible to change the “From” address in publications. If I create a publication it comes from me as an individual but can I make these a Team or a shared mailbox address or a senior leader so the communication doesnt come from me. Hopefully it is an option I skimmed over. Thanks Ben Read More
Derivative of state ‘1’ in block ‘two_area_LFC_PID/Integrator9’ at time 8.820174943555763 is not finite.
I have simulated a system in Simulink MATLAB that I want to optimize with the PID controller.
To find the best controller coefficients, I use WOA optimization method. But when I run it, I get the following error “Derivative of state ‘1’ in block ‘two_area_LFC_PID/Integrator9’ at time 8.820174943555763 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)”. Is there a solution to my problem? I have changed the step size. I also changed the solver to ODE 15s(stiff/NDF). But the problem was not solved. I have posted the desired system image with algorithm codes for friends.
CODE:
function bestSolution = EWOA_Run_PID()
% Step 1: Initialize the input arguments for EWOA
nVar = 6;
ub = [50 50 50 50 50 50];
lb = [0.01 0.01 0.01 0.01 0.01 0.01];
MaxIter = 50;
PopulationSize = 50;
% Step 2: Define the objective function handle using EWAO_Cost_PID_CF_CE
objFcn = @(params) EWOA_Cost_PID(params);
% Step 3: Call the EWOA function
bestSolution = EWOA(nVar, lb, ub, objFcn, MaxIter, PopulationSize);
end
function bestSolution = EWOA(nVar, lb, ub, objFcn, MaxIter, PopulationSize)
% Step 1: Initialize the population
whalesPositions = bsxfun(@plus, lb, bsxfun(@times, rand(PopulationSize, nVar), (ub – lb)));
% Step 2: Evaluate the objective function for each whale
whalesCost = zeros(PopulationSize, 1);
for i = 1:PopulationSize
whalesCost(i) = objFcn(whalesPositions(i, :));
end
% Step 3: Set the initial best position and cost
[globalBestCost, gBestIndex] = min(whalesCost);
globalBestPosition = whalesPositions(gBestIndex, :);
% Step 4: Initialize elite whale
eliteWhalePosition = globalBestPosition;
eliteWhaleCost = globalBestCost;
% Step 5: Set the termination criterion parameters
maxIterWithoutImprovement = 50; % Adjust this value as needed
iterWithoutImprovement = 50;
% Main loop
for iter = 1:MaxIter
a = 2 – iter * ((2) / MaxIter); % Parameter to control the search space reduction
for i = 1:PopulationSize
% Generate random vectors
r1 = rand(1, nVar);
r2 = rand(1, nVar);
% Calculate the A and C coefficients
A = 2 * a * r1 – a;
C = 2 * r2;
% Update the position of the whales using the WOA operators
D = abs(C .* globalBestPosition – whalesPositions(i, :));
newWhalePosition = globalBestPosition – A .* D;
% Clip positions to stay within the bounds
newWhalePosition = max(newWhalePosition, lb);
newWhalePosition = min(newWhalePosition, ub);
% Evaluate the new position using the EWAO_Cost_PID_CF_CE function
newWhaleCost = EWOA_Cost_PID(newWhalePosition);
% Update the whale’s position and cost if a better solution is found
if newWhaleCost < whalesCost(i)
whalesPositions(i, 🙂 = newWhalePosition;
whalesCost(i) = newWhaleCost;
end
% Update the global best position and cost if a better solution is found
if whalesCost(i) < globalBestCost
globalBestCost = whalesCost(i);
globalBestPosition = whalesPositions(i, :);
end
end
% Check for termination criterion
if globalBestCost < eliteWhaleCost
eliteWhalePosition = globalBestPosition;
eliteWhaleCost = globalBestCost;
iterWithoutImprovement = 0;
else
iterWithoutImprovement = iterWithoutImprovement + 1;
end
% Display the best cost at each iteration
disp([‘Iteration ‘, num2str(iter), ‘: Best Cost = ‘, num2str(eliteWhaleCost)]);
% Check if termination criterion is met
if iterWithoutImprovement >= maxIterWithoutImprovement
break;
end
end
% Output the best solution found
bestSolution = eliteWhalePosition;
end
Code
function cost = EWOA_Cost_PID(params)
% Assign parameters to the base workspace using assignin
assignin(‘base’, ‘KP’, params(1));
assignin(‘base’, ‘KI’, params(2));
assignin(‘base’, ‘KD’, params(3));
assignin(‘base’, ‘KPP’, params(4));
assignin(‘base’, ‘KII’, params(5));
assignin(‘base’, ‘KDD’, params(6));
% Run the Simulink model
sim(‘two_area_LFC_PID’);
% Calculate penalties based on maximum absolute values of signals
g1 = max(abs(f1.signals.values)) – 0.25;
g2 = max(abs(f2.signals.values)) – 0.25;
g3 = max(abs(pt.signals.values)) – 0.05;
% Define a large penalty coefficient
lambda = 10^20;
% Compute penalties for constraint violations
Penalty1 = lambda * g1^2 * GetInequality(g1);
Penalty2 = lambda * g2^2 * GetInequality(g2);
Penalty3 = lambda * g3^2 * GetInequality(g3);
% Calculate the total cost
cost = J_obj.signals.values(end) + Penalty1 + Penalty2 + Penalty3;
endI have simulated a system in Simulink MATLAB that I want to optimize with the PID controller.
To find the best controller coefficients, I use WOA optimization method. But when I run it, I get the following error “Derivative of state ‘1’ in block ‘two_area_LFC_PID/Integrator9’ at time 8.820174943555763 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)”. Is there a solution to my problem? I have changed the step size. I also changed the solver to ODE 15s(stiff/NDF). But the problem was not solved. I have posted the desired system image with algorithm codes for friends.
CODE:
function bestSolution = EWOA_Run_PID()
% Step 1: Initialize the input arguments for EWOA
nVar = 6;
ub = [50 50 50 50 50 50];
lb = [0.01 0.01 0.01 0.01 0.01 0.01];
MaxIter = 50;
PopulationSize = 50;
% Step 2: Define the objective function handle using EWAO_Cost_PID_CF_CE
objFcn = @(params) EWOA_Cost_PID(params);
% Step 3: Call the EWOA function
bestSolution = EWOA(nVar, lb, ub, objFcn, MaxIter, PopulationSize);
end
function bestSolution = EWOA(nVar, lb, ub, objFcn, MaxIter, PopulationSize)
% Step 1: Initialize the population
whalesPositions = bsxfun(@plus, lb, bsxfun(@times, rand(PopulationSize, nVar), (ub – lb)));
% Step 2: Evaluate the objective function for each whale
whalesCost = zeros(PopulationSize, 1);
for i = 1:PopulationSize
whalesCost(i) = objFcn(whalesPositions(i, :));
end
% Step 3: Set the initial best position and cost
[globalBestCost, gBestIndex] = min(whalesCost);
globalBestPosition = whalesPositions(gBestIndex, :);
% Step 4: Initialize elite whale
eliteWhalePosition = globalBestPosition;
eliteWhaleCost = globalBestCost;
% Step 5: Set the termination criterion parameters
maxIterWithoutImprovement = 50; % Adjust this value as needed
iterWithoutImprovement = 50;
% Main loop
for iter = 1:MaxIter
a = 2 – iter * ((2) / MaxIter); % Parameter to control the search space reduction
for i = 1:PopulationSize
% Generate random vectors
r1 = rand(1, nVar);
r2 = rand(1, nVar);
% Calculate the A and C coefficients
A = 2 * a * r1 – a;
C = 2 * r2;
% Update the position of the whales using the WOA operators
D = abs(C .* globalBestPosition – whalesPositions(i, :));
newWhalePosition = globalBestPosition – A .* D;
% Clip positions to stay within the bounds
newWhalePosition = max(newWhalePosition, lb);
newWhalePosition = min(newWhalePosition, ub);
% Evaluate the new position using the EWAO_Cost_PID_CF_CE function
newWhaleCost = EWOA_Cost_PID(newWhalePosition);
% Update the whale’s position and cost if a better solution is found
if newWhaleCost < whalesCost(i)
whalesPositions(i, 🙂 = newWhalePosition;
whalesCost(i) = newWhaleCost;
end
% Update the global best position and cost if a better solution is found
if whalesCost(i) < globalBestCost
globalBestCost = whalesCost(i);
globalBestPosition = whalesPositions(i, :);
end
end
% Check for termination criterion
if globalBestCost < eliteWhaleCost
eliteWhalePosition = globalBestPosition;
eliteWhaleCost = globalBestCost;
iterWithoutImprovement = 0;
else
iterWithoutImprovement = iterWithoutImprovement + 1;
end
% Display the best cost at each iteration
disp([‘Iteration ‘, num2str(iter), ‘: Best Cost = ‘, num2str(eliteWhaleCost)]);
% Check if termination criterion is met
if iterWithoutImprovement >= maxIterWithoutImprovement
break;
end
end
% Output the best solution found
bestSolution = eliteWhalePosition;
end
Code
function cost = EWOA_Cost_PID(params)
% Assign parameters to the base workspace using assignin
assignin(‘base’, ‘KP’, params(1));
assignin(‘base’, ‘KI’, params(2));
assignin(‘base’, ‘KD’, params(3));
assignin(‘base’, ‘KPP’, params(4));
assignin(‘base’, ‘KII’, params(5));
assignin(‘base’, ‘KDD’, params(6));
% Run the Simulink model
sim(‘two_area_LFC_PID’);
% Calculate penalties based on maximum absolute values of signals
g1 = max(abs(f1.signals.values)) – 0.25;
g2 = max(abs(f2.signals.values)) – 0.25;
g3 = max(abs(pt.signals.values)) – 0.05;
% Define a large penalty coefficient
lambda = 10^20;
% Compute penalties for constraint violations
Penalty1 = lambda * g1^2 * GetInequality(g1);
Penalty2 = lambda * g2^2 * GetInequality(g2);
Penalty3 = lambda * g3^2 * GetInequality(g3);
% Calculate the total cost
cost = J_obj.signals.values(end) + Penalty1 + Penalty2 + Penalty3;
end I have simulated a system in Simulink MATLAB that I want to optimize with the PID controller.
To find the best controller coefficients, I use WOA optimization method. But when I run it, I get the following error “Derivative of state ‘1’ in block ‘two_area_LFC_PID/Integrator9’ at time 8.820174943555763 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)”. Is there a solution to my problem? I have changed the step size. I also changed the solver to ODE 15s(stiff/NDF). But the problem was not solved. I have posted the desired system image with algorithm codes for friends.
CODE:
function bestSolution = EWOA_Run_PID()
% Step 1: Initialize the input arguments for EWOA
nVar = 6;
ub = [50 50 50 50 50 50];
lb = [0.01 0.01 0.01 0.01 0.01 0.01];
MaxIter = 50;
PopulationSize = 50;
% Step 2: Define the objective function handle using EWAO_Cost_PID_CF_CE
objFcn = @(params) EWOA_Cost_PID(params);
% Step 3: Call the EWOA function
bestSolution = EWOA(nVar, lb, ub, objFcn, MaxIter, PopulationSize);
end
function bestSolution = EWOA(nVar, lb, ub, objFcn, MaxIter, PopulationSize)
% Step 1: Initialize the population
whalesPositions = bsxfun(@plus, lb, bsxfun(@times, rand(PopulationSize, nVar), (ub – lb)));
% Step 2: Evaluate the objective function for each whale
whalesCost = zeros(PopulationSize, 1);
for i = 1:PopulationSize
whalesCost(i) = objFcn(whalesPositions(i, :));
end
% Step 3: Set the initial best position and cost
[globalBestCost, gBestIndex] = min(whalesCost);
globalBestPosition = whalesPositions(gBestIndex, :);
% Step 4: Initialize elite whale
eliteWhalePosition = globalBestPosition;
eliteWhaleCost = globalBestCost;
% Step 5: Set the termination criterion parameters
maxIterWithoutImprovement = 50; % Adjust this value as needed
iterWithoutImprovement = 50;
% Main loop
for iter = 1:MaxIter
a = 2 – iter * ((2) / MaxIter); % Parameter to control the search space reduction
for i = 1:PopulationSize
% Generate random vectors
r1 = rand(1, nVar);
r2 = rand(1, nVar);
% Calculate the A and C coefficients
A = 2 * a * r1 – a;
C = 2 * r2;
% Update the position of the whales using the WOA operators
D = abs(C .* globalBestPosition – whalesPositions(i, :));
newWhalePosition = globalBestPosition – A .* D;
% Clip positions to stay within the bounds
newWhalePosition = max(newWhalePosition, lb);
newWhalePosition = min(newWhalePosition, ub);
% Evaluate the new position using the EWAO_Cost_PID_CF_CE function
newWhaleCost = EWOA_Cost_PID(newWhalePosition);
% Update the whale’s position and cost if a better solution is found
if newWhaleCost < whalesCost(i)
whalesPositions(i, 🙂 = newWhalePosition;
whalesCost(i) = newWhaleCost;
end
% Update the global best position and cost if a better solution is found
if whalesCost(i) < globalBestCost
globalBestCost = whalesCost(i);
globalBestPosition = whalesPositions(i, :);
end
end
% Check for termination criterion
if globalBestCost < eliteWhaleCost
eliteWhalePosition = globalBestPosition;
eliteWhaleCost = globalBestCost;
iterWithoutImprovement = 0;
else
iterWithoutImprovement = iterWithoutImprovement + 1;
end
% Display the best cost at each iteration
disp([‘Iteration ‘, num2str(iter), ‘: Best Cost = ‘, num2str(eliteWhaleCost)]);
% Check if termination criterion is met
if iterWithoutImprovement >= maxIterWithoutImprovement
break;
end
end
% Output the best solution found
bestSolution = eliteWhalePosition;
end
Code
function cost = EWOA_Cost_PID(params)
% Assign parameters to the base workspace using assignin
assignin(‘base’, ‘KP’, params(1));
assignin(‘base’, ‘KI’, params(2));
assignin(‘base’, ‘KD’, params(3));
assignin(‘base’, ‘KPP’, params(4));
assignin(‘base’, ‘KII’, params(5));
assignin(‘base’, ‘KDD’, params(6));
% Run the Simulink model
sim(‘two_area_LFC_PID’);
% Calculate penalties based on maximum absolute values of signals
g1 = max(abs(f1.signals.values)) – 0.25;
g2 = max(abs(f2.signals.values)) – 0.25;
g3 = max(abs(pt.signals.values)) – 0.05;
% Define a large penalty coefficient
lambda = 10^20;
% Compute penalties for constraint violations
Penalty1 = lambda * g1^2 * GetInequality(g1);
Penalty2 = lambda * g2^2 * GetInequality(g2);
Penalty3 = lambda * g3^2 * GetInequality(g3);
% Calculate the total cost
cost = J_obj.signals.values(end) + Penalty1 + Penalty2 + Penalty3;
end error, matlab, solve, derivative of state ‘1’ in block MATLAB Answers — New Questions
Mắt bồ câu là gì? Ý nghĩa tướng số thế nào?
Cách nhận biết mắt bồ câu · Đôi mắt to tròn, có nhãn cầu vừa đủ độ rộng để tiếp giáp với hai bờ mi mắt · Mắt to cân đối và hài hòa với gương mặt · Mắt bồ câu là đôi mắt to tròn, 2 mí rõ nét, lông mi cong nên tạo được cảm giác đôi mắt rất sáng và cuốn hút. Theo nhân tướng học đàn ông sở hữu mắt bồ câu có tính cách trầm tĩnh, cẩn trọng và rất trọng tình nghĩa. Họ rất nhiệt tình với bạn bè xung quanh. Mắt bồ câu tiết lộ điều gì về tướng số, công danh, sự nghiệp tình duyên. Mỹ nhân nào sở hữu mắt bồ câu đẹp.
proseovip
Cách nhận biết mắt bồ câu · Đôi mắt to tròn, có nhãn cầu vừa đủ độ rộng để tiếp giáp với hai bờ mi mắt · Mắt to cân đối và hài hòa với gương mặt · Mắt bồ câu là đôi mắt to tròn, 2 mí rõ nét, lông mi cong nên tạo được cảm giác đôi mắt rất sáng và cuốn hút. Theo nhân tướng học đàn ông sở hữu mắt bồ câu có tính cách trầm tĩnh, cẩn trọng và rất trọng tình nghĩa. Họ rất nhiệt tình với bạn bè xung quanh. Mắt bồ câu tiết lộ điều gì về tướng số, công danh, sự nghiệp tình duyên. Mỹ nhân nào sở hữu mắt bồ câu đẹp.proseovip Read More
how to see a serdes channel’s frequency response in simulink?
I opened the example "Architectural 112G PAM4 ADC-Based SerDes Model", and I want to see the channel’s frequency response.
I tried function "frestimate" but it didn’t work.I opened the example "Architectural 112G PAM4 ADC-Based SerDes Model", and I want to see the channel’s frequency response.
I tried function "frestimate" but it didn’t work. I opened the example "Architectural 112G PAM4 ADC-Based SerDes Model", and I want to see the channel’s frequency response.
I tried function "frestimate" but it didn’t work. serdes, frequency response, channel loss, simulink MATLAB Answers — New Questions
Unable to read MAT-file C:UsersPRINCE PCAppDataRoamingMathWorksMATLABR2016amatlabprefs.mat – How do I fix this
As the title states, I keep getting that error message anytime I launch MATLAB. I suspect it has to do with a forced shut down with the figure window open as this was what happened last before that error start appearing. Please how do I fix this:
Error – Unable to read MAT-file C:UsersPRINCE PCAppDataRoamingMathWorksMATLABR2016amatlabprefs.mat
Version – R2016a
Ps: I have tried locating the file yet can’t find it (no folder named AppData on that path).As the title states, I keep getting that error message anytime I launch MATLAB. I suspect it has to do with a forced shut down with the figure window open as this was what happened last before that error start appearing. Please how do I fix this:
Error – Unable to read MAT-file C:UsersPRINCE PCAppDataRoamingMathWorksMATLABR2016amatlabprefs.mat
Version – R2016a
Ps: I have tried locating the file yet can’t find it (no folder named AppData on that path). As the title states, I keep getting that error message anytime I launch MATLAB. I suspect it has to do with a forced shut down with the figure window open as this was what happened last before that error start appearing. Please how do I fix this:
Error – Unable to read MAT-file C:UsersPRINCE PCAppDataRoamingMathWorksMATLABR2016amatlabprefs.mat
Version – R2016a
Ps: I have tried locating the file yet can’t find it (no folder named AppData on that path). error, matlab r2016a, matlabprefs.mat MATLAB Answers — New Questions
sometimes the function triggers when i trigger the sensor, sometimes it triggers without me triggering it, sometimes it won’t trigger even through multiple attempts.
hi, I am new to this and I have problem with my function. For some reason the software can’t sense when I trigger the sensor or it triggers without me triggering the sensor. The result was so random and I couldn’t find the problem. Thank you for reading this.
function [accelDataArray, accelDataArray2] = collectSamples(serialObject1, sampleNum, serialObject2, sampleNum2)
sampleCounter1 = 1;
accelDataArray = zeros(sampleNum, 1);
sampleCounter2 = 1;
accelDataArray2 = zeros(sampleNum2, 1);
triggered = false; % Initialize the trigger condition
% Wait for the trigger condition (preliminary loop)
disp(‘Waiting for trigger…’);
%%fix 282 to 312
while ~triggered
if serialObject1.BytesAvailable < 20 || serialObject2.BytesAvailable < 20
continue;
end
header1 = fread(serialObject1, 1);
header2 = fread(serialObject2, 1);
if header1 ~= 85 || header2 ~= 85
fread(serialObject1, 1);
fread(serialObject2, 1);
continue;
end
dataBytes1 = fread(serialObject1, 19);
dataBytes2 = fread(serialObject2, 19);
if dataBytes1(1) ~= 97 || dataBytes2(1) ~= 97
continue;
end
azL = dataBytes1(6);
azH = dataBytes1(7);
az = double(typecast(uint8([azL azH]), ‘int16’)) / 32768 * 16;
azL2 = dataBytes2(6);
azH2 = dataBytes2(7);
az2 = double(typecast(uint8([azL2 azH2]), ‘int16’)) / 32768 * 16;
if az > .1 || az2 > .1 % Trigger condition, adjust the threshold as needed
triggered = true;
disp(‘Triggered, now collecting samples…’);
end
end
% Data collection loop
while sampleCounter1 <= sampleNum || sampleCounter2 <= sampleNum2
% Read data from sensor 1
if serialObject1.BytesAvailable >= 20
header1 = fread(serialObject1, 1);
if header1 == 85
dataBytes1 = fread(serialObject1, 19);
if dataBytes1(1) == 97
azL = dataBytes1(6);
azH = dataBytes1(7);
az = double(typecast(uint8([azL azH]), ‘int16’)) / 32768 * 16;
accelDataArray(sampleCounter1) = az;
sampleCounter1 = sampleCounter1 + 1;
end
end
end
% Read data from sensor 2
if serialObject2.BytesAvailable >= 20
header2 = fread(serialObject2, 1);
if header2 == 85
dataBytes2 = fread(serialObject2, 19);
if dataBytes2(1) == 97
azL2 = dataBytes2(6);
azH2 = dataBytes2(7);
az2 = double(typecast(uint8([azL2 azH2]), ‘int16’)) / 32768 * 16;
accelDataArray2(sampleCounter2) = az2;
sampleCounter2 = sampleCounter2 + 1;
end
end
end
end
endhi, I am new to this and I have problem with my function. For some reason the software can’t sense when I trigger the sensor or it triggers without me triggering the sensor. The result was so random and I couldn’t find the problem. Thank you for reading this.
function [accelDataArray, accelDataArray2] = collectSamples(serialObject1, sampleNum, serialObject2, sampleNum2)
sampleCounter1 = 1;
accelDataArray = zeros(sampleNum, 1);
sampleCounter2 = 1;
accelDataArray2 = zeros(sampleNum2, 1);
triggered = false; % Initialize the trigger condition
% Wait for the trigger condition (preliminary loop)
disp(‘Waiting for trigger…’);
%%fix 282 to 312
while ~triggered
if serialObject1.BytesAvailable < 20 || serialObject2.BytesAvailable < 20
continue;
end
header1 = fread(serialObject1, 1);
header2 = fread(serialObject2, 1);
if header1 ~= 85 || header2 ~= 85
fread(serialObject1, 1);
fread(serialObject2, 1);
continue;
end
dataBytes1 = fread(serialObject1, 19);
dataBytes2 = fread(serialObject2, 19);
if dataBytes1(1) ~= 97 || dataBytes2(1) ~= 97
continue;
end
azL = dataBytes1(6);
azH = dataBytes1(7);
az = double(typecast(uint8([azL azH]), ‘int16’)) / 32768 * 16;
azL2 = dataBytes2(6);
azH2 = dataBytes2(7);
az2 = double(typecast(uint8([azL2 azH2]), ‘int16’)) / 32768 * 16;
if az > .1 || az2 > .1 % Trigger condition, adjust the threshold as needed
triggered = true;
disp(‘Triggered, now collecting samples…’);
end
end
% Data collection loop
while sampleCounter1 <= sampleNum || sampleCounter2 <= sampleNum2
% Read data from sensor 1
if serialObject1.BytesAvailable >= 20
header1 = fread(serialObject1, 1);
if header1 == 85
dataBytes1 = fread(serialObject1, 19);
if dataBytes1(1) == 97
azL = dataBytes1(6);
azH = dataBytes1(7);
az = double(typecast(uint8([azL azH]), ‘int16’)) / 32768 * 16;
accelDataArray(sampleCounter1) = az;
sampleCounter1 = sampleCounter1 + 1;
end
end
end
% Read data from sensor 2
if serialObject2.BytesAvailable >= 20
header2 = fread(serialObject2, 1);
if header2 == 85
dataBytes2 = fread(serialObject2, 19);
if dataBytes2(1) == 97
azL2 = dataBytes2(6);
azH2 = dataBytes2(7);
az2 = double(typecast(uint8([azL2 azH2]), ‘int16’)) / 32768 * 16;
accelDataArray2(sampleCounter2) = az2;
sampleCounter2 = sampleCounter2 + 1;
end
end
end
end
end hi, I am new to this and I have problem with my function. For some reason the software can’t sense when I trigger the sensor or it triggers without me triggering the sensor. The result was so random and I couldn’t find the problem. Thank you for reading this.
function [accelDataArray, accelDataArray2] = collectSamples(serialObject1, sampleNum, serialObject2, sampleNum2)
sampleCounter1 = 1;
accelDataArray = zeros(sampleNum, 1);
sampleCounter2 = 1;
accelDataArray2 = zeros(sampleNum2, 1);
triggered = false; % Initialize the trigger condition
% Wait for the trigger condition (preliminary loop)
disp(‘Waiting for trigger…’);
%%fix 282 to 312
while ~triggered
if serialObject1.BytesAvailable < 20 || serialObject2.BytesAvailable < 20
continue;
end
header1 = fread(serialObject1, 1);
header2 = fread(serialObject2, 1);
if header1 ~= 85 || header2 ~= 85
fread(serialObject1, 1);
fread(serialObject2, 1);
continue;
end
dataBytes1 = fread(serialObject1, 19);
dataBytes2 = fread(serialObject2, 19);
if dataBytes1(1) ~= 97 || dataBytes2(1) ~= 97
continue;
end
azL = dataBytes1(6);
azH = dataBytes1(7);
az = double(typecast(uint8([azL azH]), ‘int16’)) / 32768 * 16;
azL2 = dataBytes2(6);
azH2 = dataBytes2(7);
az2 = double(typecast(uint8([azL2 azH2]), ‘int16’)) / 32768 * 16;
if az > .1 || az2 > .1 % Trigger condition, adjust the threshold as needed
triggered = true;
disp(‘Triggered, now collecting samples…’);
end
end
% Data collection loop
while sampleCounter1 <= sampleNum || sampleCounter2 <= sampleNum2
% Read data from sensor 1
if serialObject1.BytesAvailable >= 20
header1 = fread(serialObject1, 1);
if header1 == 85
dataBytes1 = fread(serialObject1, 19);
if dataBytes1(1) == 97
azL = dataBytes1(6);
azH = dataBytes1(7);
az = double(typecast(uint8([azL azH]), ‘int16’)) / 32768 * 16;
accelDataArray(sampleCounter1) = az;
sampleCounter1 = sampleCounter1 + 1;
end
end
end
% Read data from sensor 2
if serialObject2.BytesAvailable >= 20
header2 = fread(serialObject2, 1);
if header2 == 85
dataBytes2 = fread(serialObject2, 19);
if dataBytes2(1) == 97
azL2 = dataBytes2(6);
azH2 = dataBytes2(7);
az2 = double(typecast(uint8([azL2 azH2]), ‘int16’)) / 32768 * 16;
accelDataArray2(sampleCounter2) = az2;
sampleCounter2 = sampleCounter2 + 1;
end
end
end
end
end #sensor MATLAB Answers — New Questions
needing help to use some codes
I used the codes of "waterfall" and "surf" to draw three figures at once
Instead of all three figures being the same color, I want each figure to have a different color than the other. please guide meI used the codes of "waterfall" and "surf" to draw three figures at once
Instead of all three figures being the same color, I want each figure to have a different color than the other. please guide me I used the codes of "waterfall" and "surf" to draw three figures at once
Instead of all three figures being the same color, I want each figure to have a different color than the other. please guide me transferred MATLAB Answers — New Questions
Install failures – App cannot be installed due to a supersedence relationship conflict
Getting installation failures that have this message: “App cannot be installed due to a supersedence relationship conflict (0x87D300DB)”. I’m trying to make sense of what I need to fix.
This is a version of software that replaces an older version of the same software, so I have supersedence set to “No” on the older piece of software, on this newer app. On a manual install, I can run the installer EXE and don’t need to uninstall the older version to get this one to install. This version has no dependencies.
On the app this supersedes, there are no dependencies or supersedences.
Interestingly, some of the installs of the same kind of computer succeed on this app that’s superseding an older version. All should have the program that this supersedes on it.
For group assignments, I have a
Where am I getting this error from, and how can I get rid of it? Thanks!
Getting installation failures that have this message: “App cannot be installed due to a supersedence relationship conflict (0x87D300DB)”. I’m trying to make sense of what I need to fix.This is a version of software that replaces an older version of the same software, so I have supersedence set to “No” on the older piece of software, on this newer app. On a manual install, I can run the installer EXE and don’t need to uninstall the older version to get this one to install. This version has no dependencies.On the app this supersedes, there are no dependencies or supersedences.Interestingly, some of the installs of the same kind of computer succeed on this app that’s superseding an older version. All should have the program that this supersedes on it.For group assignments, I have aWhere am I getting this error from, and how can I get rid of it? Thanks! Read More
Failed to create a default schedule for creating shadow copies of volume (D) Error 0x80070002
Dear Everyone!
I am requesting assistance with an issue we are experiencing on our server related to creating shadow copies. Below are the details of the problem:
Issue Description:
Error Message: “Failed to create a default schedule for creating shadow copies of volume (D). Error 0×80070002.”Affected Volume: D:
Troubleshooting Steps Taken:
Verified that the Volume Shadow Copy Service is running.Checked for any recent updates or changes in the system that might have impacted shadow copies.Attempted to create shadow copies with no success manually.I consulted online resources and forums but could not find a resolution.
Despite these efforts, the issue persists, and I am unable to create shadow copies on the specified volume.
I would appreciate your guidance on how to resolve this error. Please let me know if you need any additional information or if there are specific logs I should provide.
Thank you for your assistance.
Best regards,
Dear Everyone!I am requesting assistance with an issue we are experiencing on our server related to creating shadow copies. Below are the details of the problem:Issue Description:Error Message: “Failed to create a default schedule for creating shadow copies of volume (D). Error 0×80070002.”Affected Volume: D:Troubleshooting Steps Taken:Verified that the Volume Shadow Copy Service is running.Checked for any recent updates or changes in the system that might have impacted shadow copies.Attempted to create shadow copies with no success manually.I consulted online resources and forums but could not find a resolution.Despite these efforts, the issue persists, and I am unable to create shadow copies on the specified volume.I would appreciate your guidance on how to resolve this error. Please let me know if you need any additional information or if there are specific logs I should provide.Thank you for your assistance.Best regards, Read More
I need to log into Minecraft
For some reason I need to log into Minecraft because I’ve been in a different account but when I go into the website and put in the code that the authenticator app showed me it didn’t work I tried copying pasting all of these and still nothing can you ask me why authenticator codes stopped working I even tried it the right time and it’s says it has a problem!
For some reason I need to log into Minecraft because I’ve been in a different account but when I go into the website and put in the code that the authenticator app showed me it didn’t work I tried copying pasting all of these and still nothing can you ask me why authenticator codes stopped working I even tried it the right time and it’s says it has a problem! Read More
How do I change position of titles and subtitles of subplots?
I attached a screenshot of my plot.
I would like to put on the left (instead of above) the titles (Currents at -70mv, -50, -30 and -10) of the four subplots on the left; on the other hand, I would like to put on the right (instead of above) the titles (Currents at -60mv, -40, -20 and 0) of the four subplots on the right. This is to save space and delete some of the blank space between the subplots.
As for the subtitle ("I is 2 times slower than E"), I’d like to have only one instead of eight, possibly above all the subplots in the centre.
This is how I’m doing now (there’s another for loop "for rat = 1:colnum2" outside here but it’s not relevant for this question):
for vol = 1:colnum
subplot(4,2,vol);
plot(t_plot, currents(:,hh:zz), ‘linewidth’,2); legend(‘IPSC’, ‘EPSC’, ‘CPSC’);
str = sprintf(‘Currents at %d mV ‘, Vm(1,vol));
title(str)
subtitle([‘I is ‘, num2str(ratio(rat)), ‘ times slower than E’])
xlabel(‘Time(msec)’, ‘fontsize’, 7)
ylabel(‘Microamperes (uA)’, ‘fontsize’, 7);
hh = hh + niter;
zz = zz + niter;
end
Thanks!I attached a screenshot of my plot.
I would like to put on the left (instead of above) the titles (Currents at -70mv, -50, -30 and -10) of the four subplots on the left; on the other hand, I would like to put on the right (instead of above) the titles (Currents at -60mv, -40, -20 and 0) of the four subplots on the right. This is to save space and delete some of the blank space between the subplots.
As for the subtitle ("I is 2 times slower than E"), I’d like to have only one instead of eight, possibly above all the subplots in the centre.
This is how I’m doing now (there’s another for loop "for rat = 1:colnum2" outside here but it’s not relevant for this question):
for vol = 1:colnum
subplot(4,2,vol);
plot(t_plot, currents(:,hh:zz), ‘linewidth’,2); legend(‘IPSC’, ‘EPSC’, ‘CPSC’);
str = sprintf(‘Currents at %d mV ‘, Vm(1,vol));
title(str)
subtitle([‘I is ‘, num2str(ratio(rat)), ‘ times slower than E’])
xlabel(‘Time(msec)’, ‘fontsize’, 7)
ylabel(‘Microamperes (uA)’, ‘fontsize’, 7);
hh = hh + niter;
zz = zz + niter;
end
Thanks! I attached a screenshot of my plot.
I would like to put on the left (instead of above) the titles (Currents at -70mv, -50, -30 and -10) of the four subplots on the left; on the other hand, I would like to put on the right (instead of above) the titles (Currents at -60mv, -40, -20 and 0) of the four subplots on the right. This is to save space and delete some of the blank space between the subplots.
As for the subtitle ("I is 2 times slower than E"), I’d like to have only one instead of eight, possibly above all the subplots in the centre.
This is how I’m doing now (there’s another for loop "for rat = 1:colnum2" outside here but it’s not relevant for this question):
for vol = 1:colnum
subplot(4,2,vol);
plot(t_plot, currents(:,hh:zz), ‘linewidth’,2); legend(‘IPSC’, ‘EPSC’, ‘CPSC’);
str = sprintf(‘Currents at %d mV ‘, Vm(1,vol));
title(str)
subtitle([‘I is ‘, num2str(ratio(rat)), ‘ times slower than E’])
xlabel(‘Time(msec)’, ‘fontsize’, 7)
ylabel(‘Microamperes (uA)’, ‘fontsize’, 7);
hh = hh + niter;
zz = zz + niter;
end
Thanks! plot, subplot, plotting, matlab, title, subtitle MATLAB Answers — New Questions
change CRS in netcdf4 files
Hi, I have a bunch of netcdf4 files and need to convert to different coordinate system.
How can we do that?
thanks.Hi, I have a bunch of netcdf4 files and need to convert to different coordinate system.
How can we do that?
thanks. Hi, I have a bunch of netcdf4 files and need to convert to different coordinate system.
How can we do that?
thanks. netcdf4, crs MATLAB Answers — New Questions
Data Protection Manager 2019 – Is there way to manage Protection Group Queue?
Hi,
We use DPM for Hyper-V virtual machine backups, but we have encountered a significant issue as the number of VMs has increased. We have 5 Protection Groups on the DPM Server, each with a different number of datasources. One Protection Group has 300 datasources, and when the backup starts according to the schedule, the DPM server stops responding.
Is there a way to manage the queue for Protection Groups to prevent excessive queueing? For example, if a Protection Group starts at 11 AM, can we configure it to start backing up the first 50 datasources, then another 50 after 30 minutes, and so on? Or is the only solution to split the Protection Group into several smaller Protection Groups?
Thank you.
Hi,We use DPM for Hyper-V virtual machine backups, but we have encountered a significant issue as the number of VMs has increased. We have 5 Protection Groups on the DPM Server, each with a different number of datasources. One Protection Group has 300 datasources, and when the backup starts according to the schedule, the DPM server stops responding.Is there a way to manage the queue for Protection Groups to prevent excessive queueing? For example, if a Protection Group starts at 11 AM, can we configure it to start backing up the first 50 datasources, then another 50 after 30 minutes, and so on? Or is the only solution to split the Protection Group into several smaller Protection Groups?Thank you. Read More
Hi, I am having some trouble with a plot. I am trying to plot pressure vs. time using an equation for pressure with respect to time. Whenever I plot this I get a blank graph, so i’m not sure what the problem is. I appreciate any help!
Po = 400000;
Patm = 101325;
rhowater = 1000;
Vo = .00133333;
Anoz = pi*(.010668)^2;
syms P t
P = Po + (((-1.4*P*((P/Po)^(5/7)))/Vo)*(Anoz*sqrt((P-Patm)/rhowater)))*t;
Eqn = solve(P,t);
Peq = Eqn;
fplot(Peq,[0 1])
ylim ([0 450000])
xlabel(‘time (s) ‘)
ylabel(‘Pressure (Pa) ‘)Po = 400000;
Patm = 101325;
rhowater = 1000;
Vo = .00133333;
Anoz = pi*(.010668)^2;
syms P t
P = Po + (((-1.4*P*((P/Po)^(5/7)))/Vo)*(Anoz*sqrt((P-Patm)/rhowater)))*t;
Eqn = solve(P,t);
Peq = Eqn;
fplot(Peq,[0 1])
ylim ([0 450000])
xlabel(‘time (s) ‘)
ylabel(‘Pressure (Pa) ‘) Po = 400000;
Patm = 101325;
rhowater = 1000;
Vo = .00133333;
Anoz = pi*(.010668)^2;
syms P t
P = Po + (((-1.4*P*((P/Po)^(5/7)))/Vo)*(Anoz*sqrt((P-Patm)/rhowater)))*t;
Eqn = solve(P,t);
Peq = Eqn;
fplot(Peq,[0 1])
ylim ([0 450000])
xlabel(‘time (s) ‘)
ylabel(‘Pressure (Pa) ‘) plotting MATLAB Answers — New Questions
Exchange Server minLength > maxLength
Hey,
I’ve recently encountered this strange error in Exchange Server with no online documentation of it except for my own post on spiceworks.
It doesn’t effect mail flow, however I can’t add or remove users, modify certain parts of the database, etc.
Whenever I run `Get-User` or access the mailboxes area of ECP, I get the following error:
[PS] C:Windowssystem32>Get-User
WARNING: An unexpected error has occurred and a Watson dump is being generated: minLength > maxLength
minLength > maxLength
+ CategoryInfo : NotSpecified: (:) [Get-User], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.Exchange.Management.RecipientTasks.GetUser
+ PSComputerName : GLTX-EXCH-01.galactix.local
I have tried running a mailbox repair, but it comes back clean. I am utterly confused at why this might not be working.
Upon trying to deploy a secondary Exchange server on my network, I also found that fails too due to this bug.
The HealthCheck tool provided by MS doesn’t return anything out of the ordinary either, adding to my confusion.
Does anyone know how I might resolve this issue?
Hey,I’ve recently encountered this strange error in Exchange Server with no online documentation of it except for my own post on spiceworks.It doesn’t effect mail flow, however I can’t add or remove users, modify certain parts of the database, etc. Whenever I run `Get-User` or access the mailboxes area of ECP, I get the following error:[PS] C:Windowssystem32>Get-User
WARNING: An unexpected error has occurred and a Watson dump is being generated: minLength > maxLength
minLength > maxLength
+ CategoryInfo : NotSpecified: (:) [Get-User], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.Exchange.Management.RecipientTasks.GetUser
+ PSComputerName : GLTX-EXCH-01.galactix.local I have tried running a mailbox repair, but it comes back clean. I am utterly confused at why this might not be working. Upon trying to deploy a secondary Exchange server on my network, I also found that fails too due to this bug. The HealthCheck tool provided by MS doesn’t return anything out of the ordinary either, adding to my confusion. Does anyone know how I might resolve this issue? Read More
Excel labs: internal error while processing the request on Mac
Hello to all,
I was working on a new file on Mac testing conditional formatting – I was using Excel Labs to edit formulas without any issues. As the conditional formatting didn’t work as expected, I opened the file under Windows and worked on it. While the conditional formatting worked as expected, I get “internal error while processing the request” when I open the same file on Mac afterwards. I’m not sure what caused it and how to recover from it.
Mac version (insider): Version 16.89 (24073055)
Windows version: Version 2408 Build 16.0.17925.20000 64-bit
Hello to all, I was working on a new file on Mac testing conditional formatting – I was using Excel Labs to edit formulas without any issues. As the conditional formatting didn’t work as expected, I opened the file under Windows and worked on it. While the conditional formatting worked as expected, I get “internal error while processing the request” when I open the same file on Mac afterwards. I’m not sure what caused it and how to recover from it. Mac version (insider): Version 16.89 (24073055)Windows version: Version 2408 Build 16.0.17925.20000 64-bit Read More
Announcing Azure OpenAI Global Batch Offering: Efficient processing at scale with 50% less cost
We are excited to announce the public preview of Azure OpenAI Global Batch offering, designed to handle large-scale and high-volume processing tasks efficiently. Process asynchronous groups of requests with separate quota, with target 24-hour turnaround time, at 50% less cost than global standard.
This is a quote from our customer:
”Ontada is at the unique position of serving providers, patients and life science partners with data-driven insights. We leverage the Azure OpenAI batch API to process tens of millions of unstructured documents efficiently, enhancing our ability to extract valuable clinical information. What would have taken months to process now takes just a week. This significantly improves evidence-based medicine practice and accelerates life science product R&D. Partnering with Microsoft, we are advancing AI-driven oncology research, aiming for breakthroughs in personalized cancer care and drug development.”
Sagran Moodley, Chief Innovation and Technology Officer, Ontada
Why Azure OpenAI Global Batch?
Cost Efficiency: 50% reduction in cost compared to global standard pricing.
Separate Quota: Manage batch requests with an independent enqueued token quota, ensuring that your online workloads are unaffected. Batch quota is substantially high. Learn more.
24-Hour Turnaround: Our aim is to process batch requests within 24 hours, ensuring timely results for your usecases.
Supported Models
The following models currently support the global batch:
Model
Supported Versions
gpt4-o
2024-05-13
gpt-4o-mini
coming soon
gpt-4
turbo-2024-04-09
gpt-4
0613
gpt-35-turbo
0125
gpt-35-turbo
1106
gpt-35-turbo
0613
For the most up-to-date information on regions and models, please refer to our models page.
Key Use Cases
The Azure OpenAI Batch API opens up new possibilities across various industries and applications:
Large-Scale Data Processing: Quickly analyze extensive datasets in parallel, enabling faster decision-making and insights.
Content Generation: Automate the creation of large volumes of text, such as product descriptions, articles, and more.
Document Review and Summarization: Streamline the review and summarization of lengthy documents, saving valuable time and resources.
Customer Support Automation: Enhance customer support by handling numerous queries simultaneously, ensuring faster and more efficient responses.
Data Extraction and Analysis: Extract and analyze information from vast amounts of unstructured data, unlocking valuable insights.
Natural Language Processing (NLP) Tasks: Perform sentiment analysis, translation, and other NLP tasks on large datasets effortlessly.
Marketing and Personalization: Generate personalized content and recommendations at-scale, improving engagement and customer satisfaction.
Getting Started
Ready to try Azure OpenAI Batch API? Take it for a spin here.
Learn more
Using images in your batch input
Default batch token quota allocation and requesting increase
Microsoft Tech Community – Latest Blogs –Read More
Can not open a MATLAB example although I already installed the proposed MATLAB packages
I am trying to open a MATLAB example via typing the following command:
openExample(‘5g/NewRadioAIBasedPositioningExample’)
But I got this error:
Error using findExample
Unable to find "5g/NewRadioAIBasedPositioningExample". Check the example name and try again.
Error in openExample (line 30)
metadata = findExample(exampleId);
Although I already installed 5g and deep learning toolboxs, any help?
Thanks.I am trying to open a MATLAB example via typing the following command:
openExample(‘5g/NewRadioAIBasedPositioningExample’)
But I got this error:
Error using findExample
Unable to find "5g/NewRadioAIBasedPositioningExample". Check the example name and try again.
Error in openExample (line 30)
metadata = findExample(exampleId);
Although I already installed 5g and deep learning toolboxs, any help?
Thanks. I am trying to open a MATLAB example via typing the following command:
openExample(‘5g/NewRadioAIBasedPositioningExample’)
But I got this error:
Error using findExample
Unable to find "5g/NewRadioAIBasedPositioningExample". Check the example name and try again.
Error in openExample (line 30)
metadata = findExample(exampleId);
Although I already installed 5g and deep learning toolboxs, any help?
Thanks. deep learning, 5g, wlan MATLAB Answers — New Questions
Offers/Discounts for Volunteers of Non-Profit
Now that I’ve set up our non-profit organization with Microsoft’s non-profit grant, which includes 10 licenses of Microsoft 365 Business Premium, I’m wondering about what Microsoft 365 discounts are available to volunteers, especially Office software. It’s not clear to me what offers/discounts are available for them.
Can someone advise?
Now that I’ve set up our non-profit organization with Microsoft’s non-profit grant, which includes 10 licenses of Microsoft 365 Business Premium, I’m wondering about what Microsoft 365 discounts are available to volunteers, especially Office software. It’s not clear to me what offers/discounts are available for them.Can someone advise? Read More
How to solve this with the help of fplot
Post Content Post Content fplot, roots, plotting MATLAB Answers — New Questions