e suppose that a file name P for Engine X C httpswwwcheggcom

e suppose that a file name P for Engine X C https://www.chegg.com/homework-help/MATLAB-for-Engineers4th-edition-chapter-4-problem-4P-solution-9780133485974 BOOKS STUDY TUTORS TEST PREP INTERNSHIPS COLLEGES Chapter 4, Problem 4P Bookmark Show all steps. Problem Suppose that a file named sensor.dat contains information collected from a set of sensors. Your instructor may provide you with this file, or you may need to enter it by hand from the following data Time (s) Sensor 1 Sensor 2 Sensor 3 Sensor 4 Sensor 5 0.0000 706432 68.3470 72.3469 67.675 73.1764 0.5000 73.2823 65.7819 65.4822 71.8548 66.9929 1.0000 64.1609 72.4888 70.1794 73.6414 72.7559 1.5000 67.6970 77 442566.8623 80.5608 64.5008 2.0000 68.6878 67.2676 72.6770 63.2135 70.4300 2.5000 63.9342 65.7662 2.7644 64.8869 59.977 3.0000 63.4028 68.7683 68.9815 75.1892 67.5346 3.5000 74.6561 73.315 59.7284 68.0510 72.3102 4.0000 70.0562 65.7290 70.6628 63.0937 68.3950 4.5000 667743 63.9934 77.9647 71.577776.1828 5.0000 740286 69.4007 75.092 77.7662 66.8436 5.5000 71.1581 69.6735 62.0980 73.5395 58.373 6.0000 65.0512 72.4265 69.6067 79.7869 63.8418 6.5000 76.6979 67.0225 66.5917 72.5227 75.2782 7.0000 71.4475 69.2517 64.8772 79.3226 69.4339 7.5000 77.3946 67,8262 63.8282 68.3009 71.8961 8.0000 75.6901 69.6033 71.4440 64.30 74.7210 8.5000 66.5793 77.6758 67.8535 68.9444 59.3979 9.0000 63.5403 66.9676 70.2790 75.9512 667766 9.5000 69.6354 63.2632 68.1606 64.4190 66.4785 Each row contains a set of sensor readings, with the first row containing values collected at0 seconds, the second row containing values collected at 0.5 seconds, and so on. (a) Read the data file and print the number of sensors and the number of seconds of data contained in the file. (Hint Use the size function-don t just count the two numbers.) (b) Find both the maximum value and the minimum value recorded on each sensor. Use MATLABOto determine at what times they occurred (c) Find the mean and standard deviation for each sensor and for all the data values collected Remember, column 1 does not contain sensor data; it contains time data. 8:16 PM 10/17/2016

Solution

//Read the sensor.dat file and assumend it is in desktop
//And the delimiter is tab

File = tdread(\'C://Dharmajks/Desktop/sensor.dat\',\'\\t\');

[m,n] = size(File);
//Answer to the first question
fprintf(\'No of sensors = \',n-1);
fprintf(\'No of Time Samples taken\',m-1);

//Answer to the second & Third Question question
timestamp = File(2:m,1);
for(i=2;i<=n;i++){
   //reading columwise sensor data
   array[i] = File(2:m,i);
   //Printing min and max values of array
   [mini,I]=min(array[i]);
   fprintf(\'minimumvalue of the sensor %d is %f at %f time stamp\',i,mini,timestamp[I]);

   [maxi,J]=max(array[i]);
   fprintf(\'maximumvalue of the sensor %d is %f at %f time stamp\',i,maxi,timestamp[J]);
  
   fprintf()
   Mean[i] = mean(array[i)];
   stan[i] = std(array[i]);
   fprintf(\'meanof the sensor %d is %f \',i,Mean[i]);
   fprintf(\'StandardDeviationof the sensor %d is %f \',i,stan[i]);
}

File.close();

 e suppose that a file name P for Engine X C https://www.chegg.com/homework-help/MATLAB-for-Engineers4th-edition-chapter-4-problem-4P-solution-9780133485974 BOO

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site