 Hello everyone, myself Sanjay Uthge, assistant professor, department of electronics engineering, Valchand Institute of Technology, Solapur. Today we are going to discuss introduction to MATLAB Part 5, Learning Outcome. At the end of this session, students will be able to demonstrate system behavior using different analysis tools and functions available in MATLAB. Example, n equals to 5, s is equals to 0, for i is equals to 1 colon n, s is equal to s plus i and display s. So, in this example I have declared a constant which is having value n is equals to 5, another variable s is equals to 0. I will change the value of i which is the third variable from 1 to n that is 1 to 5. So, I will take a value as 1, 2, 3, 4, 5. So, this will come into the loop for i is equal to 1 colon n. It will execute, each time it will execute the expression s is equal to s plus i which is having a value initially 1. So, s, it will be, s value of s will be 0 plus 1, it is 1. Next, it will take a value i equals to 2. So, s will be equals to 1 plus 2, it will be 3 and so on. So, this 4 will continue till i is equals to 5 that is value of n and finally, it will display the result that is display s which is 15. Another example, let us again define n is equals to 5 s is equals to 0. Then in a loop for i which I want to 1 to n then execute expression s is equal to s plus i square n. So, again here also n having value 5, s initially 0, i that will take a value from 1 to n that is it will change after execution of a single loop it will change to 1, 2, 3, 4, 5. The loop will stop when I will reach to 5. So, each time the expression is executed as s is equal to s plus i square. So, once i becomes equals to 5 it will come out of the loop and finally, it will display the last value of s and which is 56. Now, let us take another example n equals to 5 for i is equals to 1 colon n display square root of i and remember here we are using 2 brackets, 1 bracket for displaying quantity that is square root of what a square root of i and so, initially it will display the square root of i is equals to 1 it is 1. Next it will display the square root of 2 which is 1.4142. Next time it will display a square root of 3 which is 1.7321. Again the fourth loop it will display a square root of 4 which is 2 and finally, i is equals to n that is 5 it will display the square root of 5 which is 2.2361. Another example sum is equals to 0 for i is equals to 0 to 100 with a difference of 5 sum is equal to sum plus i and display sum. Now, in this example i have assigned value to sum is equals to 0 initially then in a for loop i will take values from 0 to 100 with a difference of 5 that mean it will take all the values between 0 to 100 with a difference of 5 that is 0, 5, 10, 15, 20, 25, 30 and so on till 95 and 100 and after taking a value of i this difference value each time it will execute the expression sum is equal to sum plus i. So, the execution will come out of this for loop once i reaches to a value 100. Once i reaches to a value 100 it will execute the expression sum is equal to sum plus i and it will display a sum and which is the answer 1050. Nested loop in nested loop you will find multiple loops. The first loop is for n is equal to 1 to 5 means it will take value of n from 1, 2, 3, 4, 5. So, within this loop there is one more loop which will take values of m from 5 to 1 with a difference of minus 1. So, m will change from 1, 4, 3 to 1 whereas n will change from 1, 2, 3, 4, 5 and it will execute the equation a n comma n it is a matrix a with n rows and m columns with expression equals to n n square plus m square n n. So, initially it will take value of n is equals to 1 then it will take initially m is equals to 5 will execute this equation and assign the value to a matrix. Next with m is n is equals to same value 1 now m will change to from 5 to 4 and it will execute this below expression n square plus m square. Again in this way the m will take values from 5, 4, 3, 2, 1 each time it will execute the new value with of m with original value of n as 1. Once m reaches from 5 to 1 now n will change to 2 from 1 to 2 and similarly the n will go on changing from 1, 2, 3, 4, 5 changing of n from 1 to 2 or 2 to 3 and 3 to 4, 4 to 5 in between them m will be executed 5 times that will takes value from 5, 4, 3, 2, 1. So, the result of this is we got a matrix of n by m. So, it is a 5 by 5 matrix with these values. So, these value we got as a into bracket n comma m is equals to n square plus m square. Next program x input enter any value display if it is a greater than 0 display 0 less than 0 negative. So, it means enter the value if it is 0 it will be negative greater than 0 positive less than 0 negative plotting graph using MATLAB x is equal to 1 colon 10 y equals to x plot x y means x and y will take the same values with a title and x label and y label. So, y 2 is equal to x square plot x y 2 the result is this on a x label will give the name to the x coordinate y label will give the y coordinate with a title. This is the program for the sinusoidal waveform generation of sinusoidal waveform see the first line is a comment line with a 2 percentage sign will these lines are not executed. So, let us start with this first statement t is equals to 1 for a change ranging from minus 1 to 1 with a difference of 1 upon 100 f is equals to 1 x is equal to sign 2 pi f 2 plot t comma x label time y label and p is equal to title sinusoidal wave. So, this is the program for the generation of sinusoidal waveform with a standard equation x is equal to sign 2 pi f t f is a frequency that is 1 t that will change each time it will change values from minus 1 to 1 with a difference of 1 upon 100. This will results in a plotting of a sine wave cosine wave in similar manner there was so it is possible to plot a cosine wave. So, taking a value of t is equal to minus 1 to 1 1 upon 100 f is equals to 1 standard equation x is equal to cos 2 pi f t plot t x x label y label and title. So, this is the cosine wave with title as cosine wave x label will give the name to the x ordinate then time and y label will give the name to the y coordinate as amplitude. Question the continue statement exists the current iteration in nested loop is it true or false the answer is true these are the references. Thank you.