logo

Algorithm for calculating air quality index from sensor data in MATLAB

   

Added on  2023-04-23

3 Pages767 Words184 Views
ALGORITHM
In the first step we should load the sensor data as given the
problem in MATLAB, as we have to import data into MATLAB using
matlab import function from the tool bar. what we have to do is
first we will make excel file of sensor data provided, after that we
will import data using import options provided in MATLAB
interface, and after importing that file we can save that file in .mat
format assigning a name to it, For example -We can save imported
data as name sensor data.mat,We can load that data using MATLAB
command “load sensor data.mat”.For each sensor reading, we will
assign variable r1,r2,r3...!with location code.

As given in the problem statement our next step is assigning all
conversion factor for each sensor. example: - for sensor 1
conversion factor is 2.3, for sensor 2 conversion factor is 3, As there
are 6 sensors, so we will take 6 variables for each sensor, we will
assign in Matlab as c1=2.3, c2=2, c3=1....! You can also save those
value into .mat file and can be loaded again in future.

Now, we have to Calculate air quality index for a given sensor: -
𝑅𝑛 𝑐𝑛
𝑛=0 where R is the sensor reading and c is the conversion
factor. We can create a loop system for calculation of air quality
index of each sensor from n=1 to n=6 and for each n that is sensor
number as r is mmultiplied with its conversion factor as r1*c1,
r2*c3.

Now next step is to take input from the user, for which we will
implement switch cases through which inputs are taken and
matched with sensor number. Input will be the sensor number as
specified in the document.

User will be asked to enter the sensor number then if the sensor
number gets matched(like if someone give number greater than 6,
it should give a error because we have only six sensors) means its

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Algorithm for calculating air quality index for sensor data in MATLAB
|3
|767
|424

NHE2484: Communication System
|16
|1730
|269

NHE2484: Communication System | Assignment
|18
|1721
|330

Calculation of the Fib (n) with MARIE
|9
|583
|341