greetings, please explane or go in details for part III in specific PART I: A si
ID: 3813377 • Letter: G
Question
greetings,
please explane or go in details for part III in specific
PART I: A simple function
Please write simple.m. This file should define a simple function,
y=x^2.
PART II: A complex function
Please write student_df_3.m, a file that outputs the probability
density of student's t distribution with 3 degrees of freedom.
student_3(x) = 6*sqrt(3) / ( pi * (3 + x^2)^2)
PART III: Anti-derivative functions
Write ad_simple.m and ad_student_df_3.m that are the anti-derivatives of the functions found in simple.m and student_df_3.m, respectively.
you can use the built-in function in octave or matlab.
upload the four m files.
thanks
Explanation / Answer
simple.m
function f = simple()
f = @(x) (x^2);
end
student_df_3.m
function f = student_df_3()
f = @(x) ((6*sqrt(3))/(pi * (3 + x^2)^2));
end
ad_simple.m
function ad_derv = ad_simple(l,r)
f = simple();
ad_derv = quad(f,l,r);
end
ad_student_df_3.m
function ad_derv = ad_student_df_3(l,r)
f = student_df_3();
ad_derv = quad(f,l,r);
end
Note: Keep all four files in single folder. Antiderivative of a function means the integral of that function. So, the two functions ad_student_df_3.m and ad_simple.m take two numeric inputs l and r i.e interval/range of integration.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.