Writ a MATLAB that will: The data file \"measurementData.mat\" contains sets of
ID: 1716090 • Letter: W
Question
Writ a MATLAB that will:
The data file "measurementData.mat" contains sets of volatage measurements trials strored in the variable vData. Each row of the 2D vData contains 50 voltage measurements for a trial. write a MATLAB program that will determine the minimum, maximum, and median voltage for each of the N trials. The minimum, maximum, and median voltages for each trial should be saved in three seperate 1D araays named minvData, maxvData and medvData respectively. your program does not need to display anything as outputs in the command window.
Explanation / Answer
Method 1: Uisng Matlab Functions
clc;
clear all;
close all;
load measurementData.mat
minvData=min(vData);
maxvData=max(vData);
medvData=median(vData);
Method 2: Without Using Matlab Functions
clc;
clear all;
close all;
load measurementData.mat
minvData=Inf;
maxvData=-Inf;
sumvData=0;
for i=1:1:length(vData)
sumvData=sumvData+vData(i);
if vData(i)<minvData
minvData=vData(i);
end
if vData(i)> maxvData
maxvData=vData(i);
end
end
medvData=sumvData/length(vData);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.