00:01
We are going to write a user defined matlab function for the following math function y of x equal 0 .6 times x cubed times exponential of negative 0 .47x plus 1 .5 times x squared times exponential of negative 0 .6x the input to the function we are going to create in matlab is x and the output is y.
00:35
We write the function such that x can be a vector, that is we use element by element operations.
00:42
In part a we use the function we are creating to calculate y at negative 2 and y at 4.
00:52
In part b we use the function to make a plot of the function y of x for x greater than or equal to negative 4 and less than or equal to 8.
01:01
That is plot the function y of x on the closed interval from negative 4 to 8.
01:10
Here we have the function, the function is only one line let's say.
01:15
The number of the function has been suggested in this code to call your function.
01:19
We have these lines right here, line number 3, line number 4 and line number 7.
01:27
We are calling the function with parameters for negative 2 and vector x in line 7.
01:35
So now name of the function is fun underscore hw underscore 1 with one parameter.
01:47
The f, the u, the n are capital letters in h, w is capital letters, o of 1 is capital but n and e are lower letters.
02:02
So we have to keep the the case of the letters because matlab codes are case sensitive.
02:11
Okay so we have the function here, we see the name, it's exactly the name we have seen in line 3, 4 and 7 in the main code...