Currently the code to do the sampling has the basic structure: each variable is hard coded and sampled and after that, each sample is hard coded into a total matrix.
For example, the portion of the code that samples the fuselage length and diameter looks something like this:
% fuse diameter sample - from a normal distribution
fuse_dia_sam = lhsnorm(fuse_dia_mean, fuse_dia_err, NUM_OF_SAMP);
total_sample_mat = fuse_dia_sam;
% fuse length sample - from a normal distribution
fuse_len_sam = lhsnorm(fuse_len_mean, fuse_length_err, NUM_OF_SAMP);
total_sample_mat = [total_sample_mat fuse_len_sam];
This looks rather ugly and it happens to repeat N times where N is the total number of variables being sampled. Also the cleaner code should help improve development speed.
It would be nice if this could all be refactored into one function (SRP!) and also not hard code the sampling of each variable (perhaps a for loop).
Currently the code to do the sampling has the basic structure: each variable is hard coded and sampled and after that, each sample is hard coded into a total matrix.
For example, the portion of the code that samples the fuselage length and diameter looks something like this:
This looks rather ugly and it happens to repeat
N
times whereN
is the total number of variables being sampled. Also the cleaner code should help improve development speed.It would be nice if this could all be refactored into one function (SRP!) and also not hard code the sampling of each variable (perhaps a for loop).