Some MATLAB help needed Write a function named "week1" > The function should take two inputs: 1) a string containing the subject's code 2) a vector of 5 scores >The function should return two values: 1) the mean of the 5 scores, after removing the lowest one 2) the standard error of the mean of the 5 scores after removing the lowest one > The function should also do the following when run: 1) print the following line to the screen "Working on subject XXXX..." where XXXX is the subject code 2) plot a bar graph with the 5 scores
@ganeshie8 @hartnn @UnkleRhaukus
you have @UnkleRhaukus also add @dan815 :)
Thanks, I really can't think of a code now!
@Kainui
SE = s/sqrt(n)
where s is the sample standard deviation, and n is the number of samples
math part is fine dan :)
2) the standard error of the mean of the 5 scores after removing the lowest one for this part do you still want to use all 5 scores to find your SE just with the mean of 4 highest scores now
Actually main problem is the defining function for getting a string as input
function out=method(string,vector)
ok, so how is this function [mean, error]=week1(a,b)
ya
function [mean, error]= yourInitials_week1(a,b) mean = length(a); error=length(b); when I run it says: ??? Input argument "a" is undefined. Error in ==> yourInitials_week1 at 2 mean = length(a);
what did u input for a
still nothing when I call function this error comes up
>> yourInitials_week1 ??? Input argument "a" is undefined. Error in ==> yourInitials_week1 at 2 mean = length(a);
can u please answer this question for me xD
" 2) the standard error of the mean of the 5 scores after removing the lowest one for this part do you still want to use all 5 scores to find your SE just with the mean of 4 highest scores now "
4 highest
ok
function [mean1, SE]= yourInitials_week1(subcode,vector) vector=sort(vector) vector1=vector(2:length(vector)) mean1=mean(vector1) SE=std(vector1)/sqrt(length(vector1)) display (subcode) bar(vector)
maybe you should code the std function yourself
Oh thanks, let me work on it a little
Join our real-time social learning platform and learn together with your friends!