00:01
Hello, let's have a look at the question.
00:03
So now we have to write a matlab script here.
00:07
So first of all, let us clear all the values that were written previously in the program.
00:16
Then we will close all the extra programs that were opened.
00:24
Then we will clear using clc all the errors or whatever was there in the program.
00:32
And then we will take format long g now let us take prompt is equals to inverted comma input value of integer and let us write here question mark and let us leave a small space after question mark and then we will write in theverted comma close then semicolon then we will write x is equal to input prompt.
01:24
Now this statement will allow the user to add the value for the prompt.
01:32
Now let us take err max is equals to 1e minus 6.
01:41
So this is the maximum value of the allowed error.
01:46
Now next we will take sum is equals to and initial is also be taken as 1.
01:59
Now we will start our loop as while absolute exponent x minus sum divided by exponent x multiplied by 100 should be less than the maximum error allowed.
02:29
Now in the next line we will have after while sum is equal to sum plus x dot to the power n initial divided by factorial and initial and semicolon...