© Distribution of this video is restricted by its owner
Transcript ×
Auto highlight
Font-size
00:06 So I, um the time it's to start the class. So what

00:22 say is slide that I rushed through the end of the last lectures

00:27 Spend a few minutes in the beginning this class. Thio, uh,

00:32 a little bit more about last couple slides from last lecture and a couple

00:38 the slides I didn't get to in last lecture, so that shouldn't take

00:42 that long. And then I will on to math. Um, today's

00:50 topic and then I'll say the last minutes force the judge to do kind

00:59 like them off using math lab. this is kind of a little bit

01:05 the big outline for today's lecture. general questions, I guess before I

01:22 talking about and there should be, know, you can interrupt, obviously

01:29 specific topics or slides in the and then and they sort of interacted

01:39 on that. So you're starting You're welcome to ask questions, so

01:43 demo will pretty much show you what will talk about in terms of the

01:50 , and I thought it would be for you to both have the slides

01:54 well as life them or that also recorded. So you have in some

02:02 you get a little bit of repetition what's on the slide. So you

02:05 two different versions for covering. The issues are features on Matt Plan.

02:18 unless their particular comments questions on right , so spend the next five ish

02:25 or so on the last few slides last Lecture and one was this loss

02:30 significance that I talked about that. , there is no standard recipe for

02:38 you try to mitigate the issues of of significance that typically happens when you

02:47 two floating point values that are almost same settlements. The number of the

02:54 digits are the same in the two you're trying Thio subject. So the

03:03 example is what's for this type of , and the point is here that

03:07 a small and that means the square off X Square plus one is not

03:15 that different from one. So, , and all the techniques are ideas

03:24 reducing the loss of significance and this of scenarios when you do subtraction is

03:33 make sure that somehow you expose separately small quantity without having to do

03:44 subtractions off floating point numbers that are the same. So that's the one

03:49 to keep in mind, to convert expression to something were these small numbers

03:55 exposed, and hopefully, in this , you may remember there's this rule

04:03 if you have to expressions, um if principal a plus B and you

04:13 it by a minus, bi, result. Issei squared minus B squared

04:20 . You can use that for this here by then multiplying and dividing the

04:28 , as it's given with the right side by taking the square root off

04:36 X Square plus one plus one instead the minus one and ridiculous in some

04:41 , dividing by the same numbers. basically, it's what you see after

04:47 first parenthesis on the second role is identical to number one because it's the

04:53 number on on the nominator and denominator but now, if you actually then

05:02 out the multiplication of the tooth first before the division sign, then what

05:10 get using this s squared minus B technology As a result, it's

05:15 The X Squared is explicitly exposed and known America competition involved in getting the

05:25 squared exposed. So it turns out you do this thing, then we

05:31 something that is, uh gives you accuracy. And here is kind of

05:38 example then, but then use a feature or all functions like sine

05:47 And And this means you're actually in case are going to make use off

05:55 property of sine X Close to X zero is almost ex Andi. We'll

06:05 about it later if you don't remember know of it from some previous classes

06:10 there is a serious expansion of Sine that you can use for which the

06:15 term is the variable X itself. now if you use this serious

06:24 uh, then just symbolically, what left us a leading term is X

06:29 again. We don't need in an competition to do that, just just

06:34 manipulation. And now it's more variable is exposed to now the thing that

06:42 exactly represented, hopefully is that Cuba divide about three factorial and liberal order

06:50 . So this is just examples How you can, um, be

06:56 on use your knowledge of and it's of a tricks, as I mentioned

07:01 time, so just wanted to emphasize this is important to keep in

07:07 And unfortunately, one has to be and trying to figure out how to

07:12 loss of recession on This is just in terms of take functions that are

07:20 that they want to reduce things toe first period. If the argument is

07:25 in the first period. The one I did not talk about waas um

07:33 DNs um, numbers. And that's you normally wouldn't have to worry

07:39 On the other hand, some of may and get involved in writing software

07:44 the lower level and then, actually the number of presentation in the machine

07:48 really important. And there has been different machine representations of numbers. That

07:56 how are they? Different bits are into advice or a work.

08:05 um, the in to computer memory they didn't endedness. Indian nous means

08:13 least significant debt is the one in vocation with the lowest memory address,

08:21 as you go through and successfully higher down. If you like in

08:30 then you get more significant bits. if you go from low to high

08:34 addresses, you get the least The first and the most significant get

08:42 . Where is the big Andy The total opposite. So in that

08:47 , the most significant bit comes first you go down in terms of or

08:52 in their militarists. So the bit little Indian, as was dominating for

09:03 some time on it's kind of natural you do, which was the case

09:08 early days of computing, that a of things were kind of bit serial

09:13 . And then it's kind, electoral many competitions to start from the least

09:20 debt and move up in significance. you do add numbers you have carries

09:24 the lower order to the higher order , for example, and that's very

09:29 . And in the little India But nowadays, most computers are actually

09:37 Well, um, it's changed, should say, and the big Indian

09:44 was used by IBM early on, then, not too long ago,

09:49 actually a few years the chance, now most computers are little Indian,

09:56 it's not guaranteed. So that means , um, has to d and

10:02 about what the Indian is, is ? If you run colds on different

10:08 or you move data from one to and it's written will run former Indian

10:12 and then not be read by computer the different concept of Indian as things

10:20 totally wrong, unless you're aware off difference. And that's kind of things

10:25 software folks will have to deal with make sure that that and the N

10:31 is consistent between our data is written I was used. So I was

10:37 of mostly for computer folks. And way sometimes it's definitely it's just traveled

10:44 this slide, and sometimes you have descriptor that tells, Oh, in

10:50 endedness the data is and written, it's kind of a header. If

10:55 like to say the following data is with this Indian ness and then the

11:03 ISS than something that can be interpreted , whether it's Lydia little Indian ist

11:11 Big Indian ist. So they're called that regardless of how you read

11:15 get the same meaning, Uh, descriptor and that, I think,

11:24 very much what I have. Plus couple of examples that are being talked

11:30 , and you may want to look and sometimes position on. But in

11:37 off, either in the n S fronting point, issues have cost pretty

11:45 events in terms of rockets blowing for instance. So this is just

11:53 this is important to understand. It's important to understand this, uh,

11:59 of significant position and groundings. And just the wrap up on last

12:08 Yeah. So with that, I'll trying take questions while I switch to

12:16 slice from today. No, I didn't go. Sorry.

12:36 right again. Okay. It's so there are no questions, um,

12:59 wrap up of last lecture I will talk about that. That that you

13:09 be using for the assignment assignment. a pencil and paper problems, and

13:17 , uh, there is were asked produce some math, simple maps that

13:23 programming excises will be tons and tons lines of code. It should be

13:31 lines of cold, some conscious very few lines and some plans,

13:36 10 ish lines of cold. So focus is not on the programming,

13:44 what the program represents and how it . Um, so Matt, Lamb

13:55 states, basically the name came out it being intended for. Use some

14:03 . I'll talk a little bit more the history and the next side,

14:08 the particular complex that will cover today little bit what it is on operations

14:16 flow control a little bit about the . So, as I said,

14:24 little bit of the history of Matt Lauer was created by three Moeller.

14:30 Klay Moeller was computer scientists would event an American analysis. There was a

14:37 at University of New Mexico when they to develop Math Lab on his intention

14:44 that he didn't want the student that his American analysis course, too,

14:54 to learn programming languages as well. that time, the dominating programming language

15:02 fortunate. So we really wanted You kind of a high level

15:08 If you like to functions or FORTRAN and that's kind off is in a

15:18 places, you can tell that mad may have been originated in the fortune

15:27 . The Today It's a very rich of tools on it has lots of

15:35 popular tool boxes and the something I last time, the reason for using

15:41 in the class that is the most distributed to a software suite for numerical

15:54 off. So the basic nature. are other packages that are kind of

16:00 on symbolic money manipulations, but it's available the map time. There are

16:06 packages that may be more focused on differential equations, and so there are

16:13 of them out there. But this chances are very high and that

16:19 whatever is next in your life, plan will be something that is available

16:24 you on that part of the reason choosing it. And it's typically developed

16:32 the company. Work math works that responsible from that time, together with

16:39 institutions. So it's very come. of the A miracle functions in

16:47 Lamb comes out of universities, and it's not only commercialized, but it's

16:54 and reported all kinds off execution environments the company. So and here is

17:08 an example of the areas, application remains for which there are two

17:14 associated in that time. Here's another kind of long list that you

17:20 see in it batteries. I'm not to go into any one of

17:24 But just to emphasize that it's a environment, there's more. No,

17:35 structure. Architectural Matt Lamb. It a graphical user interface that is quite

17:41 and also has several commander interface. generates dot net files that for

17:52 fast for functions and that fast for and data. So Mohammed and I

18:04 a question about Matt Le is the of the top of high level language

18:09 SQL, where it converts SQL and see and then into assembly artists.

18:14 from Matt Lab to assembly. I'm kind of curious. Good point,

18:19 rial answer. I don't know exactly the underlying implementation is if it's predominantly

18:28 or C plus plus today and if stuff is still implemented in fortune or

18:34 they do, uh, I know the early days the mother himself.

18:42 defined the map lab language and he his own partner, and it's such

18:47 for the language, but I don't how the company does things today.

18:56 but it is an outside is kind a array or matrix oriented language that

19:03 will see him and we use it then how they parse it and translated

19:09 the stages into machine code. I know if they translated first into some

19:14 Die elected, which, um, makes sense somebody else may have followed

19:20 than I have eso If anyone among know the answer, feel free to

19:27 up. Um, so here's some the features and part of the reason

19:36 I encourage you to, um produced Matha. But it also has very

19:42 features for generating thoughts that can be in producing reports not only for your

19:51 , but in other classes as Its final means the only two out

19:56 for dinner in a nice, possible . It is also part off the

20:01 of meta. There's just a screenshot want to get Andi, as I

20:10 so useful the remote Andi show the features, Uh, and so you

20:17 kind of an interactive window window in you can type whatever you want,

20:22 then began it interprets what to do response, and it has some,

20:28 know, error checking capability. And it's even trying to be clever and

20:33 corrections to your, uh, mistakes typos. So, uh, and

20:41 thought it is easier. Instead of back and forth between gambling and feature

20:48 then talking at respect to slides that go through, set the slides

20:54 And then we did the demos off on the side. Second. So

20:59 becomes less all the back and forth , uh, stammering things and keeping

21:08 in some ways. In this structured , respect to slice that you can

21:12 through yourself later on. Um, as I mentioned it, Waas created

21:23 clip from matrix manipulations early on violently on. That means it still have

21:30 on, so a raise is kind . Primary data structure is being used

21:37 math lab, so even scaler variables represented as a race when their kids

21:45 just the one by one erect Part of it is I would interpret

21:52 and historic thing based on starting up developing a fortune context is array in

22:01 cities by the fault. Let's start one. Unlike in. See where

22:07 start from. Zero uh, That is something pretty much from this

22:14 means there are. This is isn't it? In fact,

22:24 If it's the one deer A, usually called the Vector on def,

22:31 there has more than one dimension. it's typically referred to us a

22:36 even if it's more than two dimensions . Then there's also the attributes or

22:42 function size that you can use to out what I personally referred. Thio

22:50 to referred to as shape off the and then some of the context and

22:58 people use the notion of shape. , Matt Lab refers to two size

23:04 size is an array that has us interest in the rate as there are

23:10 off the raid and each entry than this one. The vector that is

23:17 vector is the extent for the number elements in that dimension off the

23:26 So trying to give examples on the half of the slide, that's a

23:33 , and ray, there were case that is signed. These two columns

23:38 three interests in each of the So it's a three by two matrix

23:43 year olds and two columns. And you ask for the size of A

23:48 get, then the vector that has entries three and two for three being

23:54 year olds until two cops. So is an example of off vectors.

24:02 the one by four arrays. The of B is in one role.

24:07 columns and see example towards the Here is has three roles and one

24:14 . So now this size is three and one college, So it's

24:20 Hopefully simple. Simple. Um, in the typical math vocabulary, the

24:32 Indians refers to roles in the The Columns Ifit's Arabi two dimensions Uh

24:42 than wanna have on this line is . They're different ways on the top

24:48 to 0.2 elements off the array. . So the first statement a to

24:59 upon equals trees means that the Value is assigned thio. The element in

25:08 second row First column over a and for a vector be than in that

25:16 . Value three is assigned to the element of B or the right most

25:23 . The number three is assigned to second element off. See,

25:32 So, um, so things within best where they're bounded brackets is basically

25:40 to elements, Whereas square breakfast something on, the next line is used

25:47 and assignments, statement or, representing lists. Um, now And

25:59 just says that when your reference uh, in an A and the

26:08 So there's a four comma fine. in the middle of the slide doesn't

26:14 work because they a is the four foreign race, so it doesn't have

26:21 columns. So that's in fact, area. And it will tell

26:26 Master, I will tell you if use it interactive Lee. That that

26:29 work on the other hand is perfectly to assign something to, uh,

26:38 element that is not originally in the . So what happens? In that

26:46 , the A gets dynamically expanded to encompass five columns. So in this

26:54 , the number 17 gets entered into fifth columns and roll number four.

27:05 . So any questions on that So this is a little bit off

27:18 rules for variable naming, just the , the regional memory, Um

27:26 the variable name, and I'll talk little bit more about that in the

27:32 . Some slides to come. there are some rules for the variable

27:37 that needs to be starting with the , and they can have underst forcing

27:42 on that pretty much it. It recognizes story one characters in the

27:48 So if you have more characters, are not distinguishing between different variable

27:56 It is case sensitive. So as says here on the slide,

28:03 what characters are upper and lower case things to be different names. And

28:11 think that zit, um, one things. And that's something I will

28:18 you to, um, I guess cognizant off because some exercises that

28:29 he asked Thio, discover what happens a fiddle competitions and single vs double

28:39 . And for that it's important. . No, that first, unless

28:46 specify anything, the position I should all the variables you're using, everything

28:54 in double by default, and that a little bit. All the I

29:01 inheritance for that's not being developed by in America. Analysts in terms of

29:09 mathematical on americal procedures and in that is kind of insurance that your results

29:17 highly accurate. So on that by the fall, things were done

29:22 64 Big Precision. As I said time, it's not always necessary for

29:28 actors and tohave 64 bit position and particular now machine learning. And that

29:38 been clear that even single position is on because of the competition of expense

29:48 energy expense. Asai emphasis last time use lower position. So for that

29:56 is explicitly specify it. In Um, characters are 16 bit

30:08 and I don't think there's much Thio, they said, in terms

30:13 that. So if you're one single when needs to specify, the one

30:18 use single, um, woman or for variables to make sure that they

30:25 represented. And as e Tripoli fortitude obvious for working this class, or

30:32 have to worry about stuff about I wouldn't say nothing else for work

30:39 this class, you know, like Americans like that. We're gonna work

30:42 , at least in the first few last time, the first next.

30:47 was a lot about the position so particular. In your first assignment next

30:53 , there will be asked to play with single and double and see what

30:59 . It will not be that in exercise for the rest of the class

31:02 will have, you know, heart single versus double. But it may

31:09 in a couple of exercises. The thing that is important in particular is

31:19 maybe not so much for the but in real life that it may

31:24 very well that one mixes things declared , um, single and double

31:34 And then the rule is, if variable and this expressions is in

31:40 the results will be in single. it's kind of conservative in the sense

31:46 it doesn't pretend you get things in position, even if most variables are

31:53 double precision, because the single is one that limits the position in many

32:00 . On the other hand, if only thing you have is an assignment

32:04 you sign a double position variable to one, then the single one gets

32:10 to double, so then it's kind in some sense gets upgraded, so

32:16 are important in terms off being clear what position you get when you evaluate

32:24 , the variables are mixed position. , then the next year is a

32:33 of slides that I have, and of them will go through fairly

32:38 And I encourage you. So just math lab and maybe used this as

32:47 and interpreting yourself and see what happens see what things you get out because

32:55 not having any interactive mode, you , you took it in and it's

32:59 very clearly what the various is. this is, um, just various

33:10 of initializing variables. You can use expressions, Thio elect. You

33:17 in the first couple of things here a sign, you know, 40

33:26 a variable. I thio the very D a r. And then you

33:32 have er is too being a war divided by five, and you just

33:37 slashed with the division operation you used square brackets. As I mentioned Thio

33:45 array and the array elements are then by in the spaces or comments and

33:56 , have that, I guess, another slide. And there are several

34:04 . I think the one thing we'll talk more about, I guess

34:08 the next slide on that. Except semicolon at the end of the line

34:14 that doesn't necessarily get echoed and printed . If you don't have the center

34:22 . Center column, it echoes what talking. There are other things that

34:26 will talk about on the next where they have semi column in the

34:32 . So if you look here at the assignment of values to be where

34:40 number of floating point values are separated spaces, um, then if you

34:47 have semi columns separating the values, means you start a new role.

34:56 roles are separated by semi columns, elements in columns are separated by commas

35:04 blank spaces, and the common separation used the expression for D. And

35:12 think I heard more of this on next slide. So no, but

35:18 there are some rules for have how are defined in terms of their

35:27 Houston. These expressions so erase when have this lists that I showed in

35:35 previous slides and using, for semi column to separate assignment of elements

35:42 Rose and the Rose are in the are filled out from top to

35:50 and then the elements on the row filled out from left to right.

35:58 the thing is, that math lab not allow what's sometimes called ragged or

36:07 the race, so that means every needs to have the same number of

36:11 in every column needs to have the number off elements. Eso here,

36:21 guess, are a few examples more is also just illustrate what's known as

36:28 notation. Where are you specifying the ? My first element, the last

36:37 and the increments that you use going first to last into so the middle

36:44 . The instrument doesn't have to be . That means it's. But if

36:51 don't specify it, it's assumed that one. So then you go from

36:57 first, the last element I just by one. So in the middle

37:02 the slide here, you're so X one call in 2010. That means

37:07 variable actually be initialized as a the array starting with the Element

37:16 Then the next element is one plus million is three, and the next

37:22 is three plus two. So the from element element is, too.

37:27 then the highest element should be no than tense. On this case.

37:33 is nine to be the highest so that's where it stops.

37:39 so one of them there's a few examples here. It also shows the

37:45 toes that is being used to signify . So, um, their

37:57 the square brackets. One corner of means that Zim principle arose. Director

38:03 And the implement is one because it's specified. But then there's the EPA

38:09 that makes it the column vector dollar the row vector. Even though,

38:15 uh, I wrote a column. not just well to safe space on

38:20 land. Simply, um, and it's kind of also given with the

38:27 where the prime is, um, H. You can see that,

38:32 , it is, in fact, G prime or prime or even the

38:36 straw is a column vector, and it's repeated, basically using a

38:42 So that means a concatenation of two to generate now at four by two

38:50 . So it also illustrates how you contaminate the race. And I think

38:55 have that, um, more on slide. Where again, Space or

39:05 separation in the list means contamination horizontally . Whereas if you use a McCollum

39:14 in the case of specifying a single now you have a race like are

39:19 come con captain ated by now um, again, no racket

39:31 So here's yet and other examples. we have X, y and Z

39:37 are very simple. Monday already, with two elements, or all of

39:43 are factory one by to erase. I think on this line, I

39:50 trying to see if can engage you the class a little bit and see

39:57 do you expect to be the outcome this particular statement? A equals X

40:05 space. Why? What do you will be the outcome and their loved

40:13 here? Yes. Check that. me. 1245 Correct. So this

40:24 want to get it's a horizontal are stone and the kind of column or

40:32 of roles. So how about this ? Mm hmm. This one we

40:40 to and then four or five. . So this one would be a

40:49 two by two Array with 12 in top five. Yeah, correct.

40:55 you. Very good with me. love that. Mhm next one.

41:01 about this one? Um, it that going to work since we don't

41:17 raked race. Correct. Very Thank you. That was a trick

41:24 because they have X space. Which waas? Kind of a that

41:32 got towards the top of this That is the one by four.

41:37 on dzi is the one by So the result would have been the

41:43 rate that is not allowed. So you, Matt. Lab throws an

41:47 in that right? Correct. It in a row. It tells Can't

41:51 this. It doesn't allow you to it and then have the contention computations

41:57 whatever you do with C P. tells me Thank you. Um,

42:06 otherwise you can specifying by using an function that you can, you

42:15 give a text string that you want be printed on Then So in this

42:20 , and the red things are, know, examples and and I used

42:25 buck. Thank Thio show them the and using the input function with the

42:34 data. And then that Fabrice response , you know, enter data.

42:38 then I tapped into on. Then next thing I prompted, or type

42:44 one to the prompt to see what now the variable, the value of

42:48 variable in one, and it correctly , too. So these are things

42:54 can play around when you can just from the slides and into the math

43:00 . These various expressions I haven't seen it works now. Zero math lamb

43:10 has a number of 15 functions on are a few of them. There

43:15 sometimes very useful. So there are . Is one of these building functions

43:24 is another one? Randall Numbers Air fundamental competitions, so it has routines

43:34 many off or for these functions and as well. But I think he's

43:41 . A few are the commonly used now, so zeros means everything gets

43:50 to zero, whatever that thing and I'll give you some more

43:53 um, slides to come. But there's a parameter that follows in this

43:59 names, so if you just have parameter like to the first one

44:07 presidents, parenthesis and the end. it creates, in fact, the

44:13 the array or shape or precise and not have vocabulary that is end

44:21 And but you can specify whatever shape want and in this case and commands

44:28 still a two D. But you have many more dimensions of the

44:32 and you can specify each dimension The rape particularly, only give it

44:39 number. Agenda is to to the square correct and fills it with

44:46 Or you can feel it with or you can feel it within the

44:53 . Or you have also another high that I will talk about on the

44:58 like the cup eso Here's again, example off using the three dimensions often

45:07 , and I wanted to be zeros the way that things are printed by

45:16 plan. Is it Prince? It's of hard to do visualization off more

45:23 two dimensions, so it chooses to off print each instance in this case

45:29 the third Dimension, and it tells which dimension it is that you

45:36 um, there is uh, another . Then I was signing the Thio

45:50 123 and 456 Thio, The first this plane, if you like the

45:59 dimensional. All right, so is what you get the two columns is

46:06 using all elements of that dimension. basically a tech, uh, all

46:15 , all roles and all columns off first plane in this case. So

46:21 . Yet the first row again is and the second rule is 456 And

46:26 Iwas the two by three in terms planes. And then you can use

46:34 signed values to the kind of second third dimension of C second plane,

46:40 I call it. And then they these values and see, I'm

46:47 It should be to I'm sorry. my typo on this slide. I

46:52 fix it. Um, and here , um, some other exercise.

47:01 showing again the assignment off values to by three. The right a.

47:11 then you can have the city and from the previous slide. Eso It's

47:20 second plane is correct. From What's at the bottom of the previous

47:24 and Now, if you let um, the continent con captain nation

47:30 the two planes off see by vertical The nation using the semi column,

47:39 fact, get the same as the Matrix A. That's just playing around

47:44 expressions. See how they worked on trying to address another important aspect.

47:57 as you probably are aware off that languages, most of them C four

48:06 for sure eventually turn all array it expression sense or a range the race

48:17 they are defined into one. The and see and Fortune uses different

48:26 You No one is using what's known column major order, and the other

48:31 is using roll major order in terms mapping higher, dimensional raised onto the

48:39 dimensional array. So Matt type internally his column. Aging order. So

48:49 in Arctic again, this example with Matrix A that has shown here that

48:57 A is an allocated in memory has on the right on this slide.

49:05 it basically says, If you look the magic, say the first four

49:10 in the memory are then the first . Then comes the second column and

49:15 third column, and this can actually used in my plan. So you

49:22 the point it to elements of a the typical, um, the rain

49:32 . So you want the second element the first draw, which is clear

49:37 number two. But you can also to directly into the flattens array,

49:45 which two is now number five in race, so you can point directly

49:49 the one day structure created. of course, make sure you get

49:54 element you want. You need to aware off that the flattening process is

49:59 column major order. Um, there just different forms of assignment again,

50:12 , or rather, the retrieval. first, it's the assignment of elements

50:15 their A one and the other three from are basically referencing this array and

50:23 to find out what the value So clearly the third element in this

50:27 is just the one by five. right, so the third element is

50:33 , so that's what you get. can also use kind of a list

50:40 in this case, what you It's the first and the fourth element

50:44 the air A one. So what get return is one from a one

50:49 the fourth element, which is minus . Or you can use the trip

50:55 petition to get an array of Uh, another example. I had

51:03 , um, get a different way selecting elements. So again for the

51:11 , for instance in like to know the to the recreation and right to

51:19 . In that case, a retrieval for a day to the first one

51:25 basically give me all the elements of first no first columns. All

51:33 um, so the column is so it's no first group. Sorry,

51:42 one on Go through All the columns colonists in the column entry of the

51:48 are it from being confusing here? it's basically 123 The first thing before

51:54 semi column Um, the second statement basically using all roles, but not

52:06 columns. So the second argument in retrieval, or for a way to

52:13 the first column and then strike to the next column. So basically,

52:18 this case, it just becomes fallen and three, and that's what you

52:23 than being displayed. There is an using the random function on and

52:33 with one argument in the parameter Five. That creates a five by

52:38 array off normalized uniform. Random numbers zero and one, and they're uniformly

52:46 by the fall on. So that's Uniforms, random number generator on

52:54 um, interval. Sarah the one I didn't check up um sugar,

53:04 they don't know me right now whether are also other random damage. Jenner's

53:12 different distribution and built into my flab the investment need thio than generate different

53:22 and uniforms on your own. Potentially the uniform random number generator s a

53:30 And I think the rest of I here is just to get different ways

53:34 referencing elements off the memory. So is very very I'm only one.

53:42 want the elements elements out of the and 2nd row, but Onley in

53:47 student three. So then you basically selective set developments and then you can

53:52 that for competitions or whatever you want do with it. And this is

53:58 simplistic give me the entire magics or can also give us a single column

54:03 gives you all the elements again off air AM. But now they're organized

54:10 column Major order on this, I go very quickly. And there's a

54:18 more things I want to talk before over to suggest to the general.

54:25 these are slides. I have talked giving examples before, and the new

54:32 that didn't cover is on the end in a way. So in that

54:40 , matter figures out of the last of an array is so, you

54:44 , as a problem and need to what it is. So in this

54:50 , for the gravy there wasa son on the top 10 is the last

54:54 . And then at least everything from second on until the last element.

55:03 , this is just another example of same thing on function. Um,

55:12 this case, another sub selection or to the end and respectable column and

55:17 . And so this is what you in this case. So,

55:26 also, this is again. You use it again for assignment, where

55:30 have what Thio want to sign on right hand side and the target of

55:36 on the left hand side, using again that you want to use,

55:47 whatever is on the right hand two elements in the 1st and 2nd

55:55 or every four, and you only to target the 1st and 4th element

56:01 each of those two roles. So know, not remember. But if

56:06 go back and look at the slide this thing, you would see that

56:12 . What happened is that 20 and will be part assigned to elements in

56:18 first draw on those especially to be first in the fourth element. That's

56:23 they show up and similarly 22 23 up in the second role again as

56:30 selector on the left hand side for equal sign. The third row is

56:36 touched. Neither is column to all , and that's clearly very different compared

56:44 if you just did this with Now you make basically right four to

56:51 array off, destitute by two So let's see what I wanted to

57:02 before. Yeah, this is replication the scaler. So if you

57:09 ah scaler value on the right hand on you have the multiplicity of values

57:16 the left hand side, the scale gets replicated assigned to each one.

57:20 don't have to enumerate exactly the places can just give the footprints sort of

57:26 where they want values to change. , on this thing, I think

57:34 have so this is a concatenation. have already talked about that. That's

57:40 you can use end arguments. One thing on this one, um,

57:48 and I'll talk about the operators a of minutes. So here is you

57:54 , um, they have function that exponentially ation on. There's also period

58:00 front of the hat function. And operators are kind of overloaded, so

58:07 speak. So they do the right for a race. But sometimes you

58:13 things to be done element wise. in that case is used to appear

58:19 define them in this case that you each element of their A to be

58:27 as supposed to multiplying their A A itself. So that's what you see

58:33 being assignment. First you have a say the second roll off the Is

58:40 a A with each element square? this is what happens, Andi.

58:47 there's a reshaped function that takes in this case of one, the

58:52 and in this case, math lab used the notion of shape. And

58:55 says that he wants to take this elements in the vector, the turn

59:01 into to the array with four rows three columns. And then it does

59:09 basically as a in the role Major order. Can you transposition on

59:18 ? And that will transposition determinants service itself. And this is just showing

59:24 now. Not to be specify the shape, not the five by

59:31 Then there's a some function that something's the first dimension. So in this

59:36 , the first dimension is they're also a sum of all elements in the

59:43 . So the results, as as columns, Azaz original, right?

59:52 , but you can summarize thing which dimension they want. But if you

59:59 specify something, that's the first So in this case, you get

60:04 column vector. That is now the of the elements from Israel.

60:12 you have Kendall products me, mean variables and find the minimum element

60:19 em again. It's not specify it by in each dimension and look at

60:26 like more carefully that it's correct. finds a minimum elements in each column

60:32 . If you wanted the total minimum , you can do, for

60:36 this but them in a ways to the minimum element off him. This'll

60:43 not the only expression you can S so this is another example.

60:51 let me see. Uh, I I will let the comments on this

60:58 and then I'll leave it to suggestion , so hopefully then will not come

61:02 this time. So I will cover I don't cover and it's not covered

61:08 the There was a next time. if it's coming in the demos,

61:12 may not talk to the slides. just shows that there are kind off

61:19 defined, but I'm going to call reserved because you can modify them.

61:24 it's a good practice, not Use the same variable name as our

61:32 defined in that flat, but I it to use for your show,

61:38 I'll take questions as well. So I start sharing my skin.

61:48 Stop. Sure. Let's find Okay, So it's nice. Cream

62:02 . I can see. Okay. , so as Professor Johnson mentioned,

62:08 you like, the demo is just much what? This sort of the

62:13 and a few extra thanks. It's intended towards having you familiarized towards mad

62:19 environment. The Jew I looks like what the syntax of different control structures

62:26 other things are. Uh, so I start just a reminder that you

62:34 can download instructions to install math lab , uh uh, using your university

62:44 . So if you go up through access you rich and inside that one

62:49 download, there's a A pdf that can download that describes the whole

62:56 You make sure you do that. , so yes, Aziz, you

63:02 in that last time. There is an interactive Web version available,

63:09 Right, right, right. yeah, last time there were a

63:13 students who were using laptops, I selfish and others which do not have

63:18 memory or processing power. So they running into issues. But the programs

63:23 crashing for them. So in that , you can also use event interface

63:28 that club. You can use your university credentials as once you sign up

63:32 them. So, yes, you feel free to try that others

63:39 uh so your first time here, a bunch off variable assignments. So

63:46 you saw through the slides that any you define, there will be double

63:52 by default. Uh, in math , you don't need thio. Define

63:59 specific data. Types like you would it in any other language, like

64:04 out in double O. Anything like . The value that you assigned deter

64:09 for the data type of that variable ah, You can also cast any

64:18 to single precision or pretty much any data types that math lab supports using

64:24 , uh, functions in this I custom, This will lead to

64:28 position here, uh, now for performing arithmetic operations. As you

64:36 As you see, A and B double position, so if you multiply

64:41 together, the output off the one be a double precision value. You

64:46 also check that using this function called . Uh, toe run. Any

64:52 . First of all, you can go to the editor tab on the

64:57 and oops. Yeah. So I a tab and just restaurant, and

65:04 should, uh, on your We'll talk about that law of nature

65:11 . Uh, so for D to you again multiply double precision numbers,

65:17 you cast it to a single output will be a single precision value

65:23 can see on the left. Addition off double and single precision value

65:31 that a result will be single precision supposed toe. If you may have

65:38 such a situation while working U c C plus plus, in those

65:43 three output will be a double So Matt Lab, for some

65:47 has decided to go against it. , uh, similarly multiplication Off to

65:54 a double and single position is a position Output, as you can see

65:57 on the left. Well, as , as you said, going against

66:02 CNC person that z, it's not people to believe that things are in

66:08 position even though there are single position numbers in there. So in

66:12 things are not for high positions. if any number in there is

66:17 So that kiss, I would say time does in America. Correct

66:22 Great. Okay. Uh, And so talking about just the very

66:32 this'll One simple colon operator is the that we signed the slides. You

66:37 use it to generate a Siri's off . So in this case, it

66:44 numbers from initial value one toe, upper limit 10th and the instrument would

66:50 off too. So in that you would get the value of X

66:54 looks like this is it's a row values 1357 and nine. Similarly,

67:03 can use this same color operators to a Siri's off values and then you

67:09 feed it to Matt Functions like Sign generate a sine wave. In this

67:17 that I've done, such as What here is generally the city's from 0

67:22 3 with an incremental 0.5, and fed that to the sine sine

67:31 multiplied it by. And if you the function blood and give the access

67:40 five times tea and by access to the value that you get by.

67:46 can get a block similar to what see. I understand any questions on

67:52 variable assignments. Yeah. No, next one thing is just a simple

68:06 structures for conditional checking something. where is the output generated by the

68:19 ? Yes. So I used plus one here on the output. Here

68:28 this one. So, as you notice, I did not have added

68:33 semi column we're seeing here. If would have done it, did

68:38 It would have not displayed anything. just removing the semicolon has you signed

68:44 slide? It echoes whatever you typed . Hopefully that answers. I haven't

68:54 these on blackboard yet, but I'll it happily. No worries. You

69:00 to do that? Okay, so next example, I just quickly read

69:10 it. It's just a small outfit . So, as you can

69:14 defined a variable X on This is structure off anything else? Uh,

69:22 structure. So you haven't if on else, and then make sure you

69:30 three depend. Keep your end. of the control structure that you start

69:37 and in this case is, it doesn't matter at that central structures

69:45 . And then you can use f . Or, uh, there are

69:49 couple more functions that you can use display anything on the console. Eso

69:55 one will be displayed on thin using , uh, another sometimes,

70:03 uh huh. That died for in first condition. I don't think

70:12 Yes, that is X less than right? So 50 less than 50

70:21 , obviously a false condition. So why that one did not execute when

70:26 came to the second condition. Next equals 50. Because in the print

70:33 , you said x less than So that's why I was like,

70:35 that a title? My thanks. then, uh, Matt lab also

70:44 a switch statement, as you can here. So you just defined switch

70:50 here, and then your cases eso will compare this variable here toe all

70:56 cases values, So if it that's fine. That particular case will

71:01 executed. If not, the default will be executed. And as you

71:07 notice, um uh, the default keyword is different than C or

71:14 If you may have used so in in those languages it's called default in

71:19 called Otherwise. And again towards the , you have the empty word.

71:27 your control structure. Any questions on ? Okay, let's move to the

71:39 one. Eso They saw conditional, , structures now towards the loops.

71:46 here's how. Ah, why, and Matt, lad Looks like

71:53 uh, math lab Only the biloute thes parenthesis for defining its condition on

72:01 much all of the, uh, , the same as any other language

72:05 may notice and then end towards there the end of yes, those mad

72:15 make the audio college the end of in the intention automatically, or we

72:21 to do it in this editor. does it automatically. So if I

72:27 enter here, makes the indentation automatically that even in developed interface, it

72:35 it automatically. If you're using any text editor and then using Matt Lab

72:41 run those trips, then you may to worry about it. Yeah,

72:46 by default in mad laboratory, just elected right. And then there are

72:55 couple of ways you can run the loop. So in this case,

73:00 eyes defined Run from 10 to 20 just remember that whatever Lou boundaries you

73:09 are inclusive. So in this in this case, 10 and 20

73:13 included while running the Fort Loof and default, the for loop increments by

73:21 . And so in that case, will see the output here that it

73:24 from 10 to 20 of it an off. One. You can also

73:29 a different implement by using the colon and providing the implement as the middle

73:36 in this. So that's then on til 20 with an implement off to

73:43 DSO that generates an output off 10 and so on. 20. Any

73:49 about that? Yeah. Yes, . No. So this is a

74:00 bit about the vectors. So as saw in the slides practice, so

74:08 is a row vector because we defined . Using space is Aziz the separators

74:13 the values. So that gets generated a row vector. Call them.

74:19 e have a question. Eyes Any difference between using whitespace separators and

74:27 separators arose. I don't think You can use both a my

74:37 There is no difference in either Uh, OK, thank you.

74:42 ? Yeah, on C l. is for clearing the console window.

74:47 thanks for answering data. Uh, . And then indexing as we saw

74:54 the slides. Uh, you can it by the parenthesis notation. So

74:59 this case, three indexes as a saw that starts from one instead of

75:06 . So if one would be the element in a so that's four,

75:10 would be the second. So that's . Uh, whenever you're trying,

75:16 subscribe theory. So in this from 2 to 5 again, the

75:22 are inclusive. So whenever you do to call on five, that will

75:29 in this is 234 and five. you can see that 5678 values from

75:40 . Then if you want to loop vector, you can do it using

75:44 for loop, and you can do can provide the boundaries for looking through

75:54 vector. In this case, I the Lent function Thio, determine the

76:01 off the director. You can also end, uh, fever to do

76:08 and then I would be assigned as industries that go from one to let

76:14 a and then you can use I a subscript for referencing values inside a

76:21 k. Another way of doing it just by simply assigning hi equals a

76:30 And in this case, I will toa the actual values inside a rather

76:37 the industries. So the output off cold cases will be the same.

76:42 just a different way of referencing the in this case, you have used

76:47 reference them using the industries. In case, you reference them using the

76:52 values inside. Director? Uh, , right. So length off a

77:04 you the actual lent off. The sighs, returns you a vector that

77:14 the shape off, uh, off the A matrix. I don't think

77:23 a huge difference between both of It's just a matter off what you

77:27 to do. So if you're just to determine the shape off a

77:34 size would be more relevant thing to . But when you're trying to look

77:39 a vector, length would be more thing I would say took,

77:51 yes. So next eyes the transport on dso just apostrophe, adding an

77:58 and, uh, in front off director's name that performs the transports operation

78:06 the doctor. So, as you , B was a column vector on

78:13 we did transpose, uh, got into a row vector just to

78:20 Okay, then, since we had as a row vector and now be

78:26 as another pro vector, we can a element Wise edition. So if

78:31 do that just a plus b transpose performs element rise addition. Now,

78:42 you're trying toe, multiply two you need to be a little bit

78:48 because in this case, if uh if you use only the multiplication

78:57 , it will actually try to perform matrix multiplication on. In this

79:02 it will be an error, because a one by seven. Yes,

79:11 and be transport is also won by vector, which are not compatible,

79:18 , shapes because the inner dimension needs be the same when you're performing

79:24 so dot and star is the element multiplication operator which you would use if

79:31 want to perform, uh, CIA product, which is what we did

79:36 some multiplication off and be transposed element came out with this. It's just

79:44 a square off each numbers. we had a as a row vector

79:50 he is a column vector. So we perform multiplication off those two that

79:56 in, ah, multiplication off a multiplication. And in this case,

80:02 the Azov won by seven and Visa by one thing, output will be

80:07 by one. Uh uh, director when we perform matrix multiplication. That's

80:14 we've got here streets, everyone. just hoping, yes, we are

80:26 of time so you'll do it next . Yeah, I think I should

80:33 next time. With that, I , uh, take a couple of

80:40 minutes. The first I looked the difference between banking size, I

80:45 asked. And so it's no difference terms of won the race, but

80:50 dimensionally raised. It turns out that length is the maximum element off the

80:57 . All right, let you get it. Thio do size organ

81:03 You get the maximum basically off each and then length is and the maximum

81:11 the interest in the sighs. All , so for one there is no

81:19 . But from what three dimensionally It's different like this. A single

81:24 and sizes a vector. So I one thing I want to steal a

81:35 . And then the other thing I to bring up waas that they have

81:41 at. And so you ask me to comment on it? Uh,

81:46 of Piazza since that is no longer cost money to use something called true

81:54 that seems to be very similar to , Right? So, yes,

82:02 is what we found out. uh, like phone called Lulu

82:07 Professor just mentioned if you have used before Theo, the interface is pretty

82:12 the same. You can post your , you can answer them, or

82:18 your classmates can answer the answer Um so for that, I just

82:24 one thing. I would just send the invites, uh, to

82:29 in a way. So you hope China, E hope this 13 platforms

82:37 like to be useful for our Yeah, definitely. I know of

82:48 least one other faculty member that is trying. Thio replaced yard so well

82:55 little versus others. Air trying, think Microsoft teams, but very mixed

83:03 of doing that instead of Piazza. we'll see how cruel it works.

83:10 please give us your comments, whether , if you find it usable and

83:17 the problems are, if and then may switch during the course of the

83:24 . But I would like to try first things many are used to be

83:29 , like, Okay, minutes. we'll continue where we left off,

83:43 to take, you know, questions. Yeah. Mhm.

83:56 Uh, I settle outpost is, , Muslim blackboard. Okay, if

84:14 are normal comments or questions I will today's lecture, and hopefully now,

84:27 a couple of hours, it takes while to convert. Zoom 80 recording

84:33 , MP four. That once That's . E o once the work have

84:41 little question. So I had a that was trying to look up the

84:46 thing, video points that you wish right, and the link is

84:52 We'll make sure that this is the link. This is what we

84:57 I'm going to send it in the , Okay? No video points or

85:05 . Oh, okay. That's what's on. All right. Now I

85:11 then I think it may map it the one, uh, that you

85:17 you. But I know if you that directly, it doesn't work.

85:23 used to, uh I e I what's going on here. Okay,

85:32 because originally there waas the doctor invested you and then I think, a

85:39 and a half or two years maybe now they phone uncle separated,

85:47 from the universities. So now is independent company on. Then they ended

85:57 using the doctor org's, uh, , not the uhh address.

86:05 so it waas because it's no longer University of Houston Project that confused me

86:15 my friend for a little bit. right. Thanks for clearing that

86:19 Yeah, it was started by, you may know, response. So

86:24 Andi is still So he's still involved and in charge of the now the

86:30 that is that developing video points, they have a deal with the University

86:35 Houston. So it's free to us and students to use it. But

86:45 a human waste products again. Let know if even the you have problems

86:56 the doctor work first pieces. Should be worried about the fact that every

87:03 we tried to sign and we get protocols error or that's fine?

87:08 So what? I had trouble with , That they haven't upgraded their security

87:16 to be what most browsers use So you need to use an older

87:21 they call the TLS transport layer security , That is, I think,

87:26 point one. So most of your , uh, well, natively used

87:33 default used 1.2, but it has option. Thio enable the older versions

87:41 TLS protocol. And then it works me. Yeah, just working.

87:45 right. Thank you. Okay. the other questions. Okay. Thank

88:05 so much for today. You. you next week. Thank you.

88:09 you also get your first assignment. . Thank you. Thanks.

-
+