 says, the first one if you see says introduction to Sylab and it says when I do that, it says pass mode, enter empty lines to continue, Sylab objects, scalars. So, when I say A equals 1, it just displays A equals 1. I am asking the next question 1 equal equal 1, equal equal is a conditional statement, it just verifies. The answer is true, it says the answer is true. String, something quoted it says this is a string. I define a polynomial in this fashion z equals z. That means it is a polynomial with variable z and with one root at 0. That means we have just defined z. Now I can define this polynomial p to be 1 plus 3 z plus 4.5 z squared. That means you can actually define things like s, z and so on. z is defined, p is defined, now I have defined a transfer function r like this which is a rational. Another example matrices define A to be this capital A to be small a, recall we defined the small a like this here. It is scale sensitive. It is a type, it is a uppercase, it is case sensitive, uppercase lower case. Let us just go up and see what we defined A to be 1 here. So A is this capital A is small a plus 1 that is 1 plus 1 2, second element is 2, third element is 3 and if you look at the second row it is 0 0 tan inverse of 1. Tan inverse of 1 so that is going to be pi by 4 but in radians. So it is going to be 0.785 59 minus 1. In all of this note that it is every time I give a command it is echoing the results. You have to remember that. So what I will do next is I will take up some other examples. So here I am doing some commands 4 plus 6 plus 12. I want to do this. I say A equals 4, B equals 6, C equals 12, A plus B plus C. So I am issuing 4 commands like this. When I do that, when I issue the first one 4 plus 6 plus 12 the answer is 22. When I give A equals 4, B equals 6, C equals 12 it is 22. 4 plus 6 plus 12, answer is 22. Then next one I say A equals 4, B equals 6, semicolon C equals 12. It says A equals 4. It does not echo B because I have put a semicolon here. The moment you put a semicolon it does not echo. C equals 12 it gives that but if I ask what is B, it says B is 6. It is just that when I put a semicolon it does not echo. Then the other important thing in Sylab is you would open a diary. The moment I open a diary command whatever I do subsequently the questions as well as answers get recorded into a file called test which I can open, edit, remove all the unnecessary files, unnecessary lines and you are done. X is equal to square root of 2 by 2. It is 1 by root 2. So this is x. Then y equals A sign of x which is pi by 4 and then I say y degree equals y times 180 divided by look at this. The command I have given is the variable I have used is percent pi. The moment I put a percent it becomes a reserved variable. It is a pi that we are familiar with. So it says the angle is 45 degrees. This is the radian to angle calculation. Essentially this is pi by 4. In radians this is pi by 4 in degrees. Now if I say diary of, remember I had opened this thing called test. There is something called test. Here it is. So I can always open an editor and it has all the commands that I executed. Since that time I started diary. It is an extremely important, extremely useful thing because you do not have to remember what are the things that worked. Typically in a session what happens is you try 10 commands, one will work because you are trying, you are learning something and then you cannot remember just one. So this is a nice one. You open the diary, close it, remember to close it. If you do not close it, my information is lost. Say the command that I gave was diary of. It closed the diary and then you have this. Edit it and so on. Now this is a very nice command. What I have done is, in fact let me give a simpler example. A equals 1, 2, let me do this, 1, 3, 5, 7, 9, 11. Let me do this up to 9. Oops, A equals 1, 3, 5, 7, 9. So I have defined a vector now of length 5. It has 5 elements, 1, 3, 5, 7, 9. Unlike in photon RC, you do not have to create the storage for that. It is generated automatically. You do not have to type it. You do not have to say it is real, integer, whatever because the normal working type in SyLab is double precision number. Instead of this, you can also do it like this. B equals 1 in increments of 2 all the way up to 9. So A and B are 9. Both are same. You can also say, if I am not mistaken, 3, let me just see. B, C equals linear space starting number 1, ending number 9, that I want 5 points. Look at C. C is also the same. The other interesting thing is, so let me use this command. So X equals 0 in increments of 0.1 up to 1 multiplied by percent pi. I put a semicolon. I do not want it to echo the result because the result may be several lines. If I do that, it will say column 1, 2, 3 and so on. So let us just define that. X is defined. Then I say Y is equal to sin x. That means all the commands are overloaded. You can carry out matrix operation on this. So sin of a vector, it calculates and it will, for example, return. Sin 0 is 0. This is 1 into pi. Sin pi is 0 and you have up to 11. You can do things like Y of 5. You can pick out a vector and you can do several vector operations. For example, if I say A equals 5, I get this 5. A equals 1 to 9, I get this. The difference is here. I have not specified the incrementing operator. That is the difference of operator. For example, when I say B equals 1 to 9, it says 1, 3, 5. The difference between successive numbers is 2. What is the difference between these? I have not specified it. So it is taken as 1. Default is 1. So when I say 1, 2, 5, it says 1, 2, 3, 4, 5 in increments of 1. It writes this and then this is B. Now it is possible to do things like, let me put B and A together, create a larger, longer vector. So I say open bracket B, A. So B is put first and then A is put on. It is as if we are writing mathematics. If we write mathematics, this is what we would do. But imagine doing this in CR Fortran. You will have to open an array, type it, dimension it and then you put all of them one by one and then next one, one by one. The next one, it has several actually very nice features. Let us look at this command. D equals A of 1 in increments of 2 up to 5 and then 1, 0, 1. Now actually this is, A is 1, 2, 3, 4, 5. Let us do the following. Let us say B equals 1 in increments of 2 up to say 20. So I have got that. Now if I say B of 1, increments of 2 up to 5, it is going to give me B of 1, B of 3, B of 5. What I have is, I have 1 is to 2 is to 5 means it is going to create a vector called 1, 3, 5. So I am saying what I mean by this is, go to B and extract the first entry. The second entry's value is 3, which is this and the third entry's value is 5, which is this and let us give up. So it is possible to do really sophisticated calculation, indexing kind of a thing in MATLAB, in Sylab. MATLAB and Sylab are very similar as pointed out earlier. All these things will work also for MATLAB. 1 to 5. So let us say, let me do this. Let me say B equals 1 is to 2 is to 20. Now let us say C equals 1 is to 3 is to, let me say 8. Now my question is what will happen if I say B of C? C is what? 147. B of C is B of 1, B of 4, B of 7. This is 1, this is 4, 5, 6, 7. That is what I mean by that. So it has a highly sophisticated indexing thing. That means you can write very complicated algorithms in just one line. Downside is debugging could be a problem. You have a very sophisticated logic built in. It could become difficult to debug. But then you can do, look at this. This is what I have done. I have taken three such entries and I appended 101. So I mean all these things you are doing, actually a lot of things in one line. Here this example shows vector, here is a vector a minus 2. This is what we would do in mathematics. Minus 2 means what? How can you subtract a vector, scalar from a vector? We normally mean subtract from every entry, which is what is done. I have subtracted from every entry. Here 2 into a, that means you multiply every vector entry by 2, subtract 1 from every entry. So that is what it is. Then similarly I have done a plus b. Answer, when I do not give, when I say, when I do not say where the answer has to be put, it creates a variable called a n s, which is a short form for a n s, puts a result. And of course, this a n s is overwritten. Every time I use another variable, another operation without a result, that result goes back to a n s. It overwrites. So here I have done some calculations. Another useful thing is what is known as this dot operator. Here for example, I have written a dot squared, by the way this, this carrot sign up arrow means to the power. So a dot square dot to the power 2 means this dot says for individual entries. So this is raised, otherwise it is, what is meant by square of a vector? There is no meaning, which is what I have done. In fact, here I have done a dot to the power a. So that means 1 to the power, 1 to the power 1, 2 to the power 2, 3 to the power 3, which is 27. This one is 4 to the power 4, 5 to the power 5. So I can do that. It has all these logical operators, which can be used as in all the conditionals. This next two slides, I will bring out some really nice features of this environment. I have created two vectors. Vector A is 1 through 9 in increments of 1. B I have defined as 9 minus a. So 9 minus 1 is 8, 9 minus 2 is 7, 9 minus 3 is 6 and so on. Now I am asking this question. I am creating a variable called tf, which is equal to a equal equal b. That means I am comparing a and b, putting the result in a result called tf, true or false. tf stands for true or false. I am just asking true or false. Wherever a is equal to b, it is going to say true and wherever it is not, it is going to say false. So here for example, nowhere is it equal. So it says that they are all false. That means a is never equal to b. But if you look at the next one, I am saying tf equals a is greater than b. Whenever a is greater than b, it is going to say true. So for example, from here onwards, 5 onwards, it is going to become true. Here look at this. True or false, tf equals b minus a greater than 2. Whenever a is greater than 2, here I am using it as a number integer. This becomes an integer operation. a is greater than 2 from here onwards, 3 onwards. So the result a is greater than 2 is going to return 0, 0, 1, 1, 1, 1. And then I am subtracting that from b. So 8 minus 0, do you follow that? I am saying a is greater than 2. When I do the comparison of entries of a with 2, first two are less than or equal to. So they are false. In other words, they are 0, 0. All others are 1. I am subtracting this vector from b vector. So first two elements do not change. 8, 7 remain as it is. All other things come down by 1. So that is what happens. So it is 5, 4, 3 and so on. So which means when I do something like this, this can by doing such a thing, you can actually do quite a few, quite a complicated thing. Normally if you have to do this, you will have to do a do loop, for loop kind of a thing. That is actually it turns out that for loops are slow in MATLAB silo. These are vector calculation environments. When you have a vector like this, 1, 2, 3, a is equal to 1 through 5 creates this. Now b equals 8 transpose. This single code means transpose gives you the, you know, initially it is a row vector. It becomes a column vector because I have taken transpose. You can, of course, extract parts of it and so on. Let us not do that. This example I want to do. Let us do that. Timer, the answer is 0. Then I say a equals 1 of 10000 comma 1. What should I do now? I should put a semicolon. If I do not do, put a semicolon, it is going to just scroll and so on. Of course, silo does not do that. In MATLAB we will do that. If I do not do this, it will just come and say, do you really want me to display everything? You have the option of getting out. You just say no. In MATLAB we will just turn away. I created that. Then I say timer. That is because I displayed. If I did not display it, let us do this following. a equals 1 of 10000, 1 timer, small amount. Now what I will do is for i equals 1 through 10000, b of i equals a of i plus a of i end. What I am doing is I am writing a for loop. It goes from 1 to 10000, b of i is a of i plus a of i and I am ending it. Just adding. I just want to show the time it takes to do this calculation. It is doing that. It took some time. Timer 1.14, here it had taken some other time. Now I say c equals a plus a. Now I have done vector calculation. a plus a, then I say timer 08. This timer actually tells you how much time it took since the last calculation. I created this once of 10000, 1. How much did you take? 0.08. Not much time. In fact, I take the same time. When I say c equals a plus a, it takes the same time. But here what I am doing is this same calculation, I am doing it here. Do you see that? Here I am calculating it as two vectors, calculating two, adding two vectors as vector calculation. Whereas here I am doing one by one. I am forcing it to go one by one and it turns out that this time is 1.14. It is many times as compared to this time. So you have to use vector calculation whenever possible in Sylab also in Matlab. There is help here. For example, if you see here help, help browser, app propose. App propose is it just checks, it looks for that word. For example, timer. So I want help on timer. I just say I go to app propose which I got in this help button. Say it opens this. If you see here, I do not know whether you can see this. It says timer. It returns the CPU time from the preceding call to timer. So you want to, you have a bunch of, you say 10 calculations, you want to find the total time. Before that you say timer, bracket nothing, semicolon. The next time you do that it will give you. Let me close that. The other thing, so it is possible to do a lot of calculations. What I want to do is I want to show you some of the graphic, graphics capability that also gives an opportunity for me to go through some of the demos. If you recall this, I was not too happy about this introduction to Sylab. That is why I switched over. The reason is that there is an attempt to introduce a lot of things in this basic introduction. So that I thought is probably little advanced. Let us go to the graphics. 2D and 3D plots. Look at all this. All these demos are there. Let us take plot 2D, plot 2D. So this is the command. Let me execute this first and it was created by this command. So x-axis is 0 in increments of 0.1 up to 6 multiplied by pi. That means it is going from 0 to 6 pi, x-axis, 0 to 6 pi, 6 into 3 is 18. 6 pi and in the y-axis I am going to plot, I am going to create a 2D plot on the x-axis it is t, y-axis it is sin t. For whatever thing that I have, I am creating a sign of that, I am plotting that. So that is what this is. And then of course I am creating x-title. Essentially it says it is a title. The first argument is the title of this. The second argument here is the x-axis. The third argument is sin t. And then the last command says grid. Grid this, so it puts this horizontal vertical lines. Alright, let me take another example. Plot 2D 1, it essentially creates log-log plot. So after whatever it is, it plots and then says x-title, y-title and then x-grid of 3. One can actually find more explanation for each of them by doing the help. Plot, let me do this parametric plot, param 3D, let me do this. The command for this, here of course in the demo, they say param 3D, no argument. No argument means they actually have a default whenever it says you give the command nothing, it is going to execute some demo file, demo command. We will see what that is. So if I execute this, this is the 3D and the command was this. When I say for example param 3D, I execute param 3D, I mean within brackets nothing. When I fire this, this is equivalent to this because this is the default thing that I have stored. When you see no argument list, fire this. So it is going to fire that. What is that thing? It is this. It says time is 0 to 0, increments of 0.1 to 5 pi and then it is a 3D plot sin t cos t and then t by 10. So t is 5 into pi which is 15 point something divided by 10 is 1.5 something. If you see the plot here, that is what I have. I have plot z axis up to about 1.5 or so. So x axis is sin t, y axis is cos t, z axis is t by 10 and then it gives some angle, at what angle you are looking and so on. Those details are here. Plot 3D. There are many actually lots of things. Contour, contour plots. What is what created this? It is given here. So one can go through that. Gray plot. So it creates that. There are some other plots. The subplot I wanted to show you. Subplot, if I do that it is possible to plot more than one in single page. How did I do that? Let me just... So I am saying this command. Look at the first line. It says subplot of 2, 2, 1. The first two argument says that my plot area is going to be divided into 2 by 2. That means total of 4 and each one is numbered. So in the first area I have plot 3D, 3D's demo, whatever that is, because that is empty bracket. That means I have whatever it is going to execute, it is going to execute and put it in location 1. Second location it is going to give an example of plot 2D. So this is 3D, this is 2D, this is histogram plot which is here and then gray plot which is here. So it is a 2 by 2. So it is possible to do in fact a 3 by 3 or 2 by 3 or 1 by 2, whatever. You can put all these things. So it is very nice. And of course once you have it, if I am not mistaken, you can print it. Any of them printer selection, landscape, portrait, black and white color, line printer. Let me see what will happen if I print it. If the printer is connected, it could print. There is an export also. Export, then I can export it as per script, file and so on. So all those features are available. So the plots are nice. Actually we have a demo of psychos. I am not happy with the psychos demo here but in the disk that we have given, the demo 2, I will just play that even if you cannot hear it, it is all right. Just follow it. At least you will be able to see how to do that.