A program has a vector of structures that stores information on experimental data that has been collected. For each experiment, up to 10 data values were obtained
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:14| Question number:12.14
All Answers
total answers (1)
Ch14Ex12.m
% create data structure
exper(3).numvals = 5;
exper(3).vals = 1:5;
exper(1).numvals = 1;
exper(1).vals = 33;
exper(2).numvals = 10;
exper(2).vals = [3:5 1.1:0.1:1.5 11];
for i = 1:length(exper)
fprintf('The average value for experiment %d',i)
fprintf(' was %.2f\n', mean(exper(i).vals))
end
need an explanation for this answer? contact us directly to get an explanation for this answer