forked from fengdu78/Coursera-ML-AndrewNg-Notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5 - 5 - Control Statements_ for, while, if statements (13 min).srt
1730 lines (1384 loc) · 31.7 KB
/
5 - 5 - Control Statements_ for, while, if statements (13 min).srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:00,180 --> 00:00:01,178
In this video, I'd like to
在这段视频中 我想
2
00:00:01,178 --> 00:00:02,587
tell you how to write
告诉你怎样
3
00:00:02,600 --> 00:00:03,842
control statements for your
为你的 Octave 程序写控制语句
4
00:00:03,842 --> 00:00:05,672
Octave programs, so things
诸如
5
00:00:05,700 --> 00:00:07,280
like "for", "while" and "if" statements
"for" "while" "if" 这些语句
6
00:00:07,350 --> 00:00:12,176
and also how to define and use functions.
并且如何定义和使用方程
7
00:00:12,480 --> 00:00:13,980
Here's my Octave window. Let
这是我们的 Octave 窗口
8
00:00:13,980 --> 00:00:16,502
me first show you how to use a "for" loop.
我先告诉你如何使用 “for” 循环
9
00:00:16,502 --> 00:00:17,888
I'm going to start by setting v
首先 我要将 v 值设为
10
00:00:17,888 --> 00:00:18,852
to be a 10 by
一个10行1列
11
00:00:18,870 --> 00:00:20,808
1 vector 0.
的零向量
12
00:00:20,830 --> 00:00:22,209
Now, here's I write
现在 我要写一个 “for" 循环
13
00:00:22,240 --> 00:00:25,071
a "for" loop for I equals 1 to 10.
让 i 等于 1 到 10
14
00:00:25,090 --> 00:00:27,608
That's for I equals Y colon 10.
写出来就是 i = 1:10
15
00:00:27,608 --> 00:00:29,905
And let's see, I'm
让我们来看看
16
00:00:29,905 --> 00:00:31,466
going to set V of I
我要设 v(i) 的值
17
00:00:31,466 --> 00:00:33,214
equals two to the
等于 2 的 i 次方
18
00:00:33,220 --> 00:00:36,848
power of I, and finally
循环最后
19
00:00:36,848 --> 00:00:37,671
end.
记得写上“end”
20
00:00:37,671 --> 00:00:39,082
The white space does not matter,
这里的空格没关系
21
00:00:39,090 --> 00:00:40,538
so I am putting the spaces
所以我就加一些空格
22
00:00:40,538 --> 00:00:41,960
just to make it look nicely indented,
让缩进后的代码看起来结构更清晰
23
00:00:41,990 --> 00:00:44,385
but you know spacing doesn't matter.
但是你要知道这里的空格没有意义
24
00:00:44,420 --> 00:00:46,163
But if I do this, then the
如果按我这样做 那么
25
00:00:46,163 --> 00:00:48,626
result is that V gets
向量 v 的值就是
26
00:00:48,626 --> 00:00:49,420
set to, you know, two to
这样一个集合 2的一次方
27
00:00:49,500 --> 00:00:51,478
the power one, two to the power two, and so on.
2的二次方 依此类推
28
00:00:51,490 --> 00:00:52,665
So this is syntax for I
于是这就是我的 i 等于 1 到 10
29
00:00:52,665 --> 00:00:55,410
equals one colon 10 that
的语句结构
30
00:00:55,410 --> 00:00:57,429
makes I loop through the
让 i 遍历 1 到 10
31
00:00:57,440 --> 00:00:59,662
values one through 10.
的值
32
00:00:59,662 --> 00:01:00,830
And by the way, you can also do
另外 你还可以通过
33
00:01:00,830 --> 00:01:02,481
this by setting your
设置你的 indices (索引) 等于 1
34
00:01:02,481 --> 00:01:04,795
indices equals one to
一直到10
35
00:01:04,800 --> 00:01:07,260
10, and so the
来做到这一点
36
00:01:07,270 --> 00:01:09,305
indices in the array from one to 10.
这时 indices 就是一个从1到10的序列
37
00:01:09,305 --> 00:01:13,249
You can also write for I equals indices.
你也可以写 i = indices
38
00:01:15,040 --> 00:01:17,805
And this is actually the same as if I equals one to 10.
这实际上和我直接把 i 写到 1 到 10 是一样
39
00:01:17,820 --> 00:01:19,459
You can do, you know, display
你可以写 disp(i)
40
00:01:19,480 --> 00:01:23,498
I and this would do the same thing.
也能得到一样的结果
41
00:01:23,498 --> 00:01:24,698
So, that is a "for" loop,
所以 这就是一个 “for” 循环
42
00:01:24,698 --> 00:01:27,201
if you are familiar with "break"
如果你对 “break” 和 “continue” 语句比较熟悉
43
00:01:27,230 --> 00:01:29,375
and "continue", there's "break" and
Octave里也有 “break” 和 “continue” 语句
44
00:01:29,375 --> 00:01:30,809
"continue" statements, you can
你也可以在 Octave环境里
45
00:01:30,809 --> 00:01:32,061
also use those inside loops
使用那些循环语句
46
00:01:32,061 --> 00:01:33,902
in octave, but first
但是首先让我告诉你
47
00:01:33,902 --> 00:01:36,550
let me show you how a while loop works.
一个 while 循环是如何工作的
48
00:01:36,570 --> 00:01:39,088
So, here's my vector
这是我的 v 向量
49
00:01:39,120 --> 00:01:40,912
V. Let's write the while loop.
让我们写个 while 循环
50
00:01:40,920 --> 00:01:44,037
I equals 1, while I
i = 1 ;
51
00:01:44,037 --> 00:01:45,259
is less than or equal to
while i <= 5 ;
52
00:01:45,259 --> 00:01:47,662
5, let's set
让我们设置
53
00:01:47,662 --> 00:01:51,082
V I equals one hundred
v(i) 等于 100
54
00:01:51,530 --> 00:01:54,449
and increment I by
然后 i 加 1
55
00:01:54,449 --> 00:01:56,644
one, end.
结束 (end)
56
00:01:56,700 --> 00:01:58,090
So this says what?
所以这是什么意思呢
57
00:01:58,090 --> 00:01:59,932
I starts off equal to
我让 i 取值从 1 开始
58
00:01:59,970 --> 00:02:01,359
one and then I'm going
然后我要
59
00:02:01,380 --> 00:02:02,629
to set V I equals one
让 v(i) 等于 100
60
00:02:02,629 --> 00:02:04,249
hundred and increment I by
再让 i 递增 1
61
00:02:04,260 --> 00:02:07,666
one until I is, you know, greater than five.
直到 i 大于 5停止
62
00:02:07,690 --> 00:02:09,377
And as a result of that,
现在来看一下结果
63
00:02:09,377 --> 00:02:13,022
whereas previously V was this powers of two vector.
原来的向量 v 是2的这些次方
64
00:02:13,022 --> 00:02:14,573
I've now taken the first
我现在已经取出了
65
00:02:14,580 --> 00:02:17,225
five elements of my vector
向量的前五个元素
66
00:02:17,260 --> 00:02:19,618
and overwritten them with this value one hundred.
把他们用100覆盖掉
67
00:02:19,618 --> 00:02:22,797
So that's a syntax for a while loop.
这就是一个while循环的句法结构
68
00:02:23,140 --> 00:02:24,503
Let's do another example.
现在我们来分析另外一个例子
69
00:02:24,503 --> 00:02:26,600
Y equals one while
i = 1; while true,
70
00:02:26,600 --> 00:02:28,491
true and here
这里我将向你展示
71
00:02:28,500 --> 00:02:31,892
I wanted to show you how to use a break statement.
如何使用break语句
72
00:02:31,892 --> 00:02:34,040
Let's say V I equals 999
比方说 v(i) = 999
73
00:02:34,070 --> 00:02:37,331
and I equals i+1
然后让 i = i+1
74
00:02:38,110 --> 00:02:45,900
if i equals 6 break and
当 i 等于6的时候 break (停止循环)
75
00:02:47,910 --> 00:02:47,910
end.
结束 (end)
76
00:02:48,410 --> 00:02:49,425
And this is also our first
当然这也是我们第一次
77
00:02:49,425 --> 00:02:51,945
use of an if statement, so
使用一个 if 语句 所以
78
00:02:51,945 --> 00:02:53,308
I hope the logic of this makes sense.
我希望你们可以理解这个逻辑
79
00:02:53,308 --> 00:02:57,297
Since I equals one and, you know, increment loop.
让 i 等于1 然后开始下面的增量循环
80
00:02:57,340 --> 00:02:59,900
While repeatedly set V I equals 1
while语句重复设置 v(i) 等于1 (此处口误 应为999 译者注)
81
00:02:59,900 --> 00:03:01,527
and increment i by 1,
不断让i增加
82
00:03:01,527 --> 00:03:02,901
and then when 1 i
然后当 i 达到6
83
00:03:02,920 --> 00:03:04,451
gets up to 6, do a
做一个
84
00:03:04,451 --> 00:03:05,757
break which breaks here although
中止循环的命令
85
00:03:05,757 --> 00:03:07,284
the while do and so, the
尽管有while循环 语句也就此中止
86
00:03:07,284 --> 00:03:08,596
effective is should be to take
所以最后的效果是
87
00:03:08,596 --> 00:03:09,929
the first five elements of this
取出向量 v 的前5个元素
88
00:03:09,929 --> 00:03:11,748
vector V and set them to 999.
并且把它们设置为999
89
00:03:11,748 --> 00:03:14,832
And yes, indeed, we're taking
然后运行 的确如此
90
00:03:14,832 --> 00:03:18,345
V and overwritten the first five elements with 999.
我们用999覆盖了 v 的前五个元素
91
00:03:18,345 --> 00:03:20,172
So, this is the
所以 这就是
92
00:03:20,172 --> 00:03:21,974
syntax for "if" statements, and
if 语句和 while 语句的句法结构
93
00:03:21,974 --> 00:03:25,058
for "while" statement, and notice the end.
并且要注意 要有end
94
00:03:25,070 --> 00:03:27,159
We have two ends here.
这里是有两个 end 的
95
00:03:27,170 --> 00:03:29,719
This ends here ends the if statement
这里的 end 结束的是 if 语句
96
00:03:29,730 --> 00:03:33,228
and the second end here ends the while statement.
第二个 end 结束的是 while 语句
97
00:03:33,250 --> 00:03:35,265
Now let me show you the more general syntax for
现在让我告诉你使用 if-else 语句时
98
00:03:35,265 --> 00:03:37,763
how to use an if-else statement.
更一般的句法结构
99
00:03:37,763 --> 00:03:40,274
So, let's see, V 1
举个例子 v(1)
100
00:03:40,274 --> 00:03:42,776
is equal to 999, let's
等于999 假设我们
101
00:03:42,860 --> 00:03:46,996
type V1 equals to 2 for this example.
令 v(1) 等于2
102
00:03:47,020 --> 00:03:48,758
So, let me type
所以 让我输入
103
00:03:48,758 --> 00:03:55,050
if V 1 equals 1 display the value as one.
if v(1) == 1, disp('The value is one');
104
00:03:56,855 --> 00:03:58,588
Here's how you write an else
这里出现了一个else语句
105
00:03:58,588 --> 00:04:00,040
statement, or rather here's an
或者更确切地说 这里是一个
106
00:04:00,040 --> 00:04:03,853
else if: V 1 equals
elseif语句 elseif v(1) == 2,
107
00:04:03,853 --> 00:04:07,815
2. This is, if in case that's true in our example, display
这就是说 如果这种情况下命题为真
108
00:04:07,815 --> 00:04:12,268
the value as 2, else
执行 disp('The value is two');
109
00:04:13,650 --> 00:04:17,960
display, the value is not one or two.
否则(else) 执行 disp('The value is not one or two');
110
00:04:17,990 --> 00:04:21,699
Okay, so that's a if-else
好了 这就是一个if-else语句
111
00:04:21,700 --> 00:04:23,889
if-else statement it ends.
if-else语句 记得最后有end
112
00:04:23,889 --> 00:04:25,271
And of course, here we've just
当然了 我们刚刚设置过
113
00:04:25,271 --> 00:04:27,589
set v 1 equals 2, so hopefully, yup,
v(1)等于2 所以显然
114
00:04:27,610 --> 00:04:30,729
displays that the value is 2.
显示的是 "The value is two"
115
00:04:30,780 --> 00:04:32,844
And finally, I don't
最后 我觉得现在
116
00:04:32,880 --> 00:04:34,143
think I talked about this earlier, but
提醒一件事
117
00:04:34,143 --> 00:04:35,622
if you ever need to exit Octave,
如果你需要退出 Octave
118
00:04:35,622 --> 00:04:36,947
you can type the exit command and
你可以键入 exit 命令然后
119
00:04:36,947 --> 00:04:38,373
you hit enter that will cause Octave
回车就会退出 Octave
120
00:04:38,400 --> 00:04:39,981
to quit or the 'q'--quits
或者命令 ‘quit’
121
00:04:39,981 --> 00:04:42,428
command also works.
也可以
122
00:04:42,450 --> 00:04:43,857
Finally, let's talk about
最后 让我们来说说
123
00:04:43,857 --> 00:04:45,292
functions and how to define
函数 (functions)
124
00:04:45,310 --> 00:04:48,592
them and how to use them.
如何定义和调用函数
125
00:04:48,620 --> 00:04:49,680
Here's my desktop, and I
这是我的桌面
126
00:04:49,720 --> 00:04:52,078
have predefined a file
我在桌面上存了一个
127
00:04:52,078 --> 00:04:56,818
or pre-saved on my desktop a file called "squarethisnumber.m".
预先定义的文件 名为 “squarethisnumber.m”
128
00:04:56,830 --> 00:04:59,471
This is how you define functions in Octave.
这就是在 Octave 环境下定义的函数
129
00:04:59,480 --> 00:05:01,681
You create a file called, you know,
你需要创建一个文件
130
00:05:01,681 --> 00:05:03,958
with your function name and then ending in .m,
用你的函数名来命名 然后以 .m 的后缀结尾
131
00:05:03,960 --> 00:05:05,694
and when Octave finds
当 Octave 发现这文件
132
00:05:05,730 --> 00:05:07,643
this file, it knows that this
它知道应该在什么位置
133
00:05:07,680 --> 00:05:12,322
where it should look for the definition of the function "squarethisnumber.m".
寻找 squareThisNumber.m 这个函数的定义
134
00:05:12,340 --> 00:05:14,076
Let's open up this file.
让我们打开这个文件
135
00:05:14,076 --> 00:05:15,717
Notice that I'm using the
请注意 我使用的是
136
00:05:15,717 --> 00:05:19,352
Microsoft program Wordpad to open up this file.
微软的写字板程序来打开这个文件
137
00:05:19,352 --> 00:05:20,250
I just want to encourage you, if
我只是想建议你
138
00:05:20,250 --> 00:05:23,379
your using Microsoft Windows, to
如果你也使用微软的 Windows 系统
139
00:05:23,379 --> 00:05:25,075
use Wordpad rather than
那么可以使用写字板程序
140
00:05:25,110 --> 00:05:27,477
Notepad to open up these
而不是记事本 来打开这些文件
141
00:05:27,490 --> 00:05:28,557
files, if you have a
如果你有别的什么
142
00:05:28,557 --> 00:05:29,938
different text editor that's fine
文本编辑器 那也可以
143
00:05:29,938 --> 00:05:33,325
too, but notepad sometimes messes up the spacing.
但记事本有时会把代码的间距弄得很乱
144
00:05:33,350 --> 00:05:34,775
If you only have Notepad, that should
如果你只有记事本程序
145
00:05:34,800 --> 00:05:36,312
work too, that could work
那也能用
146
00:05:36,312 --> 00:05:37,779
too, but if you
但最好是
147
00:05:37,779 --> 00:05:39,354
have Wordpad as well, I
如果你有写字板的话
148
00:05:39,354 --> 00:05:40,609
would rather use that or some
我建议你用写字板
149
00:05:40,610 --> 00:05:45,053
other text editor, if you have a different text editor for editing your functions.
或者其他可以编辑函数的文本编辑器
150
00:05:45,060 --> 00:05:47,155
So, here's how you define the function in Octave.
现在我们来说如何在 Octave 里定义函数
151
00:05:47,155 --> 00:05:49,816
Let me just zoom in a little bit.
我们先来放大一点
152
00:05:49,816 --> 00:05:52,516
And this file has just three lines in it.
这个文件只有三行
153
00:05:52,516 --> 00:05:54,440
The first line says function Y equals square root
第一行写着 function y = squareThisNumber(x)
154
00:05:54,440 --> 00:05:56,448
number of X, this tells
这就告诉 Octave
155
00:05:56,448 --> 00:05:57,705
Octave that I'm gonna return
我想返回一个 y 值
156
00:05:57,705 --> 00:06:00,025
the value Y, I'm gonna
我想返回一个值
157
00:06:00,025 --> 00:06:01,315
return one value and that
并且返回的这个值
158
00:06:01,315 --> 00:06:02,375
the value is going to
将被存放于
159
00:06:02,375 --> 00:06:04,443
be saved in the variable Y
变量 y 里
160
00:06:04,443 --> 00:06:06,003
and moreover, it tells Octave
另外 它告诉了 Octave
161
00:06:06,003 --> 00:06:08,068
that this function has one argument,
这个函数有一个参数
162
00:06:08,070 --> 00:06:10,408
which is the argument X,
就是参数 x
163
00:06:10,420 --> 00:06:11,846
and the way the function
还有定义的函数体
164
00:06:11,846 --> 00:06:15,156
body is defined, if Y equals X squared.
也就是 y 等于 x 的平方
165
00:06:15,180 --> 00:06:16,553
So, let's try to call
现在让我们尝试调用这个函数
166
00:06:16,553 --> 00:06:19,071
this function "square", this number
SquareThisNumber(5)
167
00:06:19,071 --> 00:06:21,854
5, and this actually
这实际上
168
00:06:21,854 --> 00:06:23,115
isn't going to work, and
是行不通的
169
00:06:23,115 --> 00:06:25,693
Octave says square this number it's undefined.
Octave 说这个方程未被定义
170
00:06:25,693 --> 00:06:28,902
That's because Octave doesn't know where to find this file.
这是因为 Octave 不知道在哪里找这个文件
171
00:06:28,902 --> 00:06:30,682
So as usual, let's use PWD,
所以像之前一样 我们??使用 pwd
172
00:06:30,690 --> 00:06:32,592
or not in my directory,
现在不在我的目录下
173
00:06:32,592 --> 00:06:36,151
so let's see this c:\users\ang\desktop.
因此我们把路径设为 "C:\User\ang\desktop"
174
00:06:36,151 --> 00:06:39,888
That's where my desktop is.
这就是我的桌面的路径
175
00:06:39,888 --> 00:06:41,276
Oops, a little typo there.
噢 打错了
176
00:06:41,276 --> 00:06:42,848
Users ANG desktop
应该是 "Users"
177
00:06:42,848 --> 00:06:44,157
and if I now type square
现在如果我
178
00:06:44,157 --> 00:06:46,728
root number 5, it returns the
键入SquareThisNumber(5)
179
00:06:46,728 --> 00:06:48,505
answer 25.
返回值是25
180
00:06:48,505 --> 00:06:50,347
As kind of an advanced feature, this
还有一种更高级的功能
181
00:06:50,347 --> 00:06:51,972
is only for those of you
这只是对那些知道
182
00:06:51,972 --> 00:06:54,596
that know what the term search path means.
“search path (搜索路径)” 这个术语的人使用的
183
00:06:54,596 --> 00:06:55,945
But so if you
所以如果你
184
00:06:55,945 --> 00:06:57,497
want to modify the Octave
想要修改 Octave
185
00:06:57,497 --> 00:06:58,863
search path and you
的搜索路径
186
00:06:58,863 --> 00:06:59,866
could, you just think of
你可以把下面这部分
187
00:06:59,866 --> 00:07:01,827
this next part as advanced
作为一个进阶知识
188
00:07:01,827 --> 00:07:03,292
or optional material.
或者选学材料
189
00:07:03,292 --> 00:07:04,214
Only for those who are either
仅适用于那些
190
00:07:04,214 --> 00:07:05,484
familiar with the concepts of
熟悉编程语言中
191
00:07:05,484 --> 00:07:07,642
search paths and permit languages,
搜索路径概念的同学
192
00:07:07,650 --> 00:07:08,962
but you can use the
你可以使用
193
00:07:08,962 --> 00:07:11,875
term addpath, safety colon,
addpath 命令添加路径
194
00:07:11,880 --> 00:07:16,241
slash users/ANG/desktop to
添加路径 “C:\Users\ang\desktop”
195
00:07:16,241 --> 00:07:17,972
add that directory to the
将该目录添加到
196
00:07:17,972 --> 00:07:19,744
Octave search path so that
Octave 的搜索路径
197
00:07:19,744 --> 00:07:21,065
even if you know, go to
这样即使你跑到
198
00:07:21,065 --> 00:07:22,611
some other directory I can
其他路径底下
199
00:07:22,611 --> 00:07:24,510
still, Octave still knows
Octave依然知道
200
00:07:24,510 --> 00:07:26,005
to look in the users ANG
会在 Users\ang\desktop