Problem #6 (20 points): we have set up a limit in current on a piece of equipmen
ID: 2292255 • Letter: P
Question
Problem #6 (20 points): we have set up a limit in current on a piece of equipment to be 0.45 Amps. When the system is running data is gather in the DAQ. The system generates a vector of 10 random numbers in one single column. The control system is comparing if the values of the result currents are higher than the limit set for the supplier. We need to project the results into a monitor for easy understanding and to take action over the equipment. If one of the parameters in the vector has a value higher than the limit, we will need to display a message that say "There is at least one current value measure above the limit", if this is not true, please isplay "All values are below the limit. You can proceed with your data acquisitionExplanation / Answer
code
clc
clear all
close all
%%
% maximum current limit
a_max = 0.45;
% vector of 10 random numbers
test = rand(10,1)'
% checking if any random number is greater than a_max
if (sum(test > a_max))
disp ('there is atleast one current value measure above the limit')
else
disp ('All values are below the limit. You can procees with your data acquisition')
end
result
test =
0.0596 0.6820 0.0424 0.0714 0.5216 0.0967 0.8181 0.8175 0.7224 0.1499
All values are below the limit. You can procees with your data acquisition
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.