Using Matlab. Please try to follow the instructions written if possible. A unive
ID: 3799965 • Letter: U
Question
Using Matlab. Please try to follow the instructions written if possible.
A university has four colleges (with enrollment number shown): Engineering (256) English (143) Liberal Arts (542) Tango (14) When starting at the university, each student takes an entry exam. Your task is to write a script that creates a structure array to store the data at this university. Each of the 4 sub-structures should have the following fields: name enroll scores To simulate the entry scores, use randi to create a vector that has one score for each of the students enrolled at that college. Let their scores range between 60 and 100. Compute these scores within a for loop, similar to the following but with the "???" replaced with proper code. Bonus points if you find a way to scale these results to make the engineering scores higher than the other colleges. for aa = 1:4 ??? = randi([60, 100], 1, ???); end After creating the structure array, compute the average entry scores for each college and use fprintf to display them in a full sentence. Use a for loop to accomplish this. Lastly, compute and display the overall average entry score.Explanation / Answer
clear all;
close all;
clc;
name1 = 'John'; enroll1 = 'Engineering';
name2 = 'harry'; enroll2 = 'english';
name3 = 'shan'; enroll3 = 'Liberal_Arts' ;
name4 = 'mike'; enroll4 = 'Tango';
for i = 1:4
score(i) = randi([60,100],1,1);
end
score_max = max(score(:));
score_min = min(score(:));
score_mean = mean(score(:));
s = struct(enroll1,score_max + randi(10),enroll2,score(2),enroll3,score(3),enroll4,score(4))
fprintf('The average is %i ',score_mean)