2015年05月02日
COURSERAのクラス進捗 5/2/2015
"Introduction to Programming with MATLAB"のWeek6を早速やってみた。今回の話題はLoopで、配列や行列の要素の操作方法を学ぶ。注意するのはMATLABの便利なプログラミング法(Logical indexing)。非常に簡潔にコードが書けるので覚えておきたい。
解説ビデオ
コードの書き方
Problem
Given a vector, v, of scalars, create a second vector, w, that contains only the non-negative elements of v.
Solution
w = [];
jj = 0;
for ii = l:length(v)
if v(ii) >= 0
jj = jj + 1;
w(jj) = v(ii);
end
end
Logical indexing
w = [];
for ii = l:length(v)
if v(ii) >= 0
w = [w v(ii)];
end
end
Videoを全部視聴して、早速宿題も全部解いた。MATLABの習得は順調。
Homework 6 Grader
Type the number of the problem that you would like to check
or choose the last option to check all problems and compute
a score and a submission code. (Nothing is submitted.)
0. EXIT
1. neighbor
2. replace_me
3. halfsum
4. large_elements
5. one_per_n
6. approximate_pi
7. separate_by_two
8. divvy
9. square_wave
10. myprime
11. ALL PROBLEMS (gives score and submission code)
Your selection: 2
NOTE: the grader will only determine if your
solution for Problem 2 is correct or not.
No score will be given.
Problem 2 (replace_me):
Feedback: Your function performed correctly for argument(s) [1 2 3], 2, 4, 5
Feedback: Your function performed correctly for argument(s) [1 2 3], 4, 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4], 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5], 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10], 2, 2
Feedback: Your function performed correctly for argument(s) [-3 -5 -4 -1 -4 -5 -4 -3 -5 -2 -2 -4 -5 -2 -2 -2 -5 -5 -5 -5 -1 -5], -2
Feedback: Your function performed correctly for argument(s) [-1 0 0 -1 0 -1 -1 1 -1 0 0 1 0 1 -1 -1 1 1 1 -1], 0, 8, 8
Your solution is correct.
>> hw6
Homework 6 Grader
Type the number of the problem that you would like to check
or choose the last option to check all problems and compute
a score and a submission code. (Nothing is submitted.)
0. EXIT
1. neighbor
2. replace_me
3. halfsum
4. large_elements
5. one_per_n
6. approximate_pi
7. separate_by_two
8. divvy
9. square_wave
10. myprime
11. ALL PROBLEMS (gives score and submission code)
Your selection: 11
Grading all problems ...
Problem 1 (neighbor):
Feedback: Your function performed correctly for argument(s) [1 2 3 4]
Feedback: Your function performed correctly for argument(s) [2 1]
Feedback: Your function performed correctly for argument(s) [1 -2 3]
Feedback: Your function performed correctly for argument(s) [8 -3 3 -5 1 -6 -8 -1 7 -2]
Feedback: Your function performed correctly for argument(s) [0.891424671420177 0.110591460888063 0.387170900099125 0.253843788797242 0.452254471901518 0.166431489478154 0.932147364807933 0.223318325589629 0.0984268686900553 0.353520286969166 0.488631127840917 0.20318518569997 0.989441807798946 0.430401071340604]
Feedback: Your function performed correctly for argument(s) [1 2;3 4]
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) []
Feedback: Your function performed correctly for argument(s) zeros(1,0)
Your solution is correct.
Problem 2 (replace_me):
Feedback: Your function performed correctly for argument(s) [1 2 3], 2, 4, 5
Feedback: Your function performed correctly for argument(s) [1 2 3], 4, 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4], 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5], 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10], 2, 2
Feedback: Your function performed correctly for argument(s) [-2 -4 -1 -2 -1 -5 -1 -2 -2 -2 -4 -5 -3 -3 -1], -2
Feedback: Your function performed correctly for argument(s) [1 1 -1 -1 1 -1 1 1 1 0 1 1 1 -1 1 1 -1 0 0 0], 0, 8, 8
Your solution is correct.
Problem 3 (halfsum):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10]
Feedback: Your function performed correctly for argument(s) [1;2;3;4;5;6;7;8]
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9]
Feedback: Your function performed correctly for argument(s) [6 10 1 1 7;1 3 4 4 1;1 6 8 6 1;1 9 6 2 1;4 3 2 4 6]
Feedback: Your function performed correctly for argument(s) [0.176096965497883 0.654159505385576 0.43017640385498 0.394581939467124 0.951985782991797 0.129182196885905 0.416640945800178 0.531029604185321 0.568692791329085 0.719048028658963 0.127623416818911 0.835350461328278;0.764538226361978 0.765373227521929 0.675946088557486 0.473769946869344 0.471277977678831 0.12241513792208 0.340915324884967 0.138492200282524 0.671503585989359 0.834264538109086 0.618037016165269 0.978937020991224;0.719112286094527 0.989519534988798 0.473231517307113 0.66583340987608 0.103462412135709 0.291149431051823 0.627061220282097 0.778820321334405 0.736324854337908 0.42120001576177 0.917100855398257 0.0675020536247704;0.202463092764134 0.903198227804808 0.596455588137084 0.649654727218335 0.740401705008778 0.614889352736 0.924307136520583 0.499348158063849 0.696828576371973 0.409953224239685 0.717868103959419 0.593911879975349;0.280384804882256 0.734168850407162 0.960112121913415 0.907969942772756 0.154383789374087 0.853991462172677 0.463382672796254 0.479744457946739 0.766305854715115 0.812556952189781 0.696714024452422 0.294971002467269;0.78938463333615 0.673902594744981 0.144389365459141 0.738145399764985 0.864911783053234 0.37541017527314 0.760646968405647 0.262742554391831 0.394295803589881 0.511605662978628 0.523280478282449 0.405137239554395;0.185039538649014 0.821321258769617 0.444561404330805 0.203559739634278 0.698354322253204 0.414459659338655 0.17227321998115 0.247327658846348 0.428446100031067 0.327818542106276 0.688037997077008 0.513847964677426]
Your solution is correct.
Problem 4 (large_elements):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10]
Feedback: Your function performed correctly for argument(s) [10 9 8 7 6 5 4 3 2 1]
Feedback: Your function performed correctly for argument(s) [1 4;5 2;6 0]
Feedback: Your function performed correctly for argument(s) [6 7 8 3 8;6 5 10 1 5;5 7 4 5 7;6 6 8 4 4;1 1 6 7 1]
Feedback: Your function performed correctly for argument(s) [15.3176592389644 1.61097477738744 9.11868646266657 0.340740945207039 3.18055312838712 6.83909544830505;17.7988025118303 18.1013059008894 19.7084577766845 16.9925854818723 5.20462935030034 12.2786239916774;6.17294740982631 9.32011123623242 15.505619664882 11.0691499865279 13.3999200357944 2.73057982301504]
Your solution is correct.
Problem 5 (one_per_n):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) 3
Feedback: Your function performed correctly for argument(s) 4
Feedback: Your function performed correctly for argument(s) 8
Feedback: Your function performed correctly for argument(s) 9
Feedback: Your function performed correctly for argument(s) 9.7875
Feedback: Your function performed correctly for argument(s) 9.7876
Feedback: Your function performed correctly for argument(s) 9.7877
Feedback: Your function performed correctly for argument(s) 9.36347732314096
Feedback: Your function performed correctly for argument(s) 9.37115422278818
Feedback: Your function performed correctly for argument(s) 9.87632869803532
Feedback: Your function performed correctly for argument(s) 9.03924032770895
Feedback: Your function performed correctly for argument(s) 9.30329034534588
Feedback: Your function performed correctly for argument(s) 10
Your solution is correct.
Problem 6 (approximate_pi):
Feedback: Your function performed correctly for argument(s) 0.1
Feedback: Your function performed correctly for argument(s) 0.01
Feedback: Your function performed correctly for argument(s) 0.001
Feedback: Your function performed correctly for argument(s) 1e-05
Feedback: Your function performed correctly for argument(s) 1e-08
Feedback: Your function performed correctly for argument(s) 1e-10
Feedback: Your function performed correctly for argument(s) 1e-14
Feedback: Your function performed correctly for argument(s) 1e-15
Feedback: Your function performed correctly for argument(s) 1e-16
Feedback: Your function performed correctly for argument(s) 1
Your solution is correct.
Problem 7 (separate_by_two):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) [1;2]
Feedback: Your function performed correctly for argument(s) [1;2;3;4;5;6;7;8;9;10]
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9]
Feedback: Your function performed correctly for argument(s) [6 4 7 4 2;3 1 6 3 10;10 8 3 1 2;8 1 5 9 8;2 1 2 10 1]
Feedback: Your function performed correctly for argument(s) [53 98 43 11 6 38 82 69;99 88 92 1 94 75 10 91;87 4 16 1 84 36 81 97;70 44 21 78 1 65 7 45;63 26 24 76 65 75 88 86;66 20 96 8 75 5 78 69;24 69 56 64 35 33 35 99;73 73 31 61 37 65 36 17;17 14 3 100 2 53 83 59;80 72 8 37 28 16 93 10;23 44 81 40 86 28 71 89]
Your solution is correct.
Problem 8 (divvy):
Feedback: Your function performed correctly for argument(s) [1 4;5 2;6 0], 3
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10], 2
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9], 3
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9], 3
Feedback: Your function performed correctly for argument(s) [19 9 6 11 18 4 16 2 3;19 16 8 13 14 15 8 11 10;15 12 13 1 3 7 11 20 12;9 13 7 12 3 19 2 10 10;16 15 10 20 19 7 1 9 1], 2
Your solution is correct.
Problem 9 (square_wave):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) 10
Feedback: Your function performed correctly for argument(s) 100
Feedback: Your function performed correctly for argument(s) 1000
Feedback: Your function performed correctly for argument(s) 4378
Your solution is correct.
Problem 10 (myprime):
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) 3
Feedback: Your function performed correctly for argument(s) 4
Feedback: Your function performed correctly for argument(s) 5
Feedback: Your function performed correctly for argument(s) 8
Feedback: Your function performed correctly for argument(s) 9
Feedback: Your function performed correctly for argument(s) 10
Feedback: Your function performed correctly for argument(s) 11
Feedback: Your function performed correctly for argument(s) 12
Feedback: Your function performed correctly for argument(s) 313
Feedback: Your function performed correctly for argument(s) 659
Feedback: Your function performed correctly for argument(s) 547
Feedback: Your function performed correctly for argument(s) 577
Feedback: Your function performed correctly for argument(s) 180683
Feedback: Your function performed correctly for argument(s) 242653
Your solution is correct.
Score: 100
しかし相変わらず、問題文がわかりにくい。
例えばこれ。
The function replace_me is defined like this: function w = replace_me(v,a,b,c). The first input argument v is a vector, while a, b, and c are all scalars. The function replaces every element of v that is equal to a with b and c. For example, the command >> x = replace_me([1 2 3],2,4,5); makes x equal to [1 4 5 3]. If c is omitted, it replaces occurrences of a with two copies of b. If b is also omitted, it replaces each a with two zeros.
こういう時はDiscussion Forumsで情報が見つかるからいいが…
また今週から始まったクラス"Computational Neuroscience"のWeek1も終了。これは人工知能というよりは、脳のメカニズムをシミュレーションする方法?を解説していくようだ。MATLABやPythonを使って解析をしていくようなので、これらの学習には使えそう。引き続きがんばって学習していこう。
解説ビデオ
コードの書き方
Problem
Given a vector, v, of scalars, create a second vector, w, that contains only the non-negative elements of v.
Solution
w = [];
jj = 0;
for ii = l:length(v)
if v(ii) >= 0
jj = jj + 1;
w(jj) = v(ii);
end
end
Logical indexing
w = [];
for ii = l:length(v)
if v(ii) >= 0
w = [w v(ii)];
end
end
Videoを全部視聴して、早速宿題も全部解いた。MATLABの習得は順調。
Homework 6 Grader
Type the number of the problem that you would like to check
or choose the last option to check all problems and compute
a score and a submission code. (Nothing is submitted.)
0. EXIT
1. neighbor
2. replace_me
3. halfsum
4. large_elements
5. one_per_n
6. approximate_pi
7. separate_by_two
8. divvy
9. square_wave
10. myprime
11. ALL PROBLEMS (gives score and submission code)
Your selection: 2
NOTE: the grader will only determine if your
solution for Problem 2 is correct or not.
No score will be given.
Problem 2 (replace_me):
Feedback: Your function performed correctly for argument(s) [1 2 3], 2, 4, 5
Feedback: Your function performed correctly for argument(s) [1 2 3], 4, 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4], 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5], 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10], 2, 2
Feedback: Your function performed correctly for argument(s) [-3 -5 -4 -1 -4 -5 -4 -3 -5 -2 -2 -4 -5 -2 -2 -2 -5 -5 -5 -5 -1 -5], -2
Feedback: Your function performed correctly for argument(s) [-1 0 0 -1 0 -1 -1 1 -1 0 0 1 0 1 -1 -1 1 1 1 -1], 0, 8, 8
Your solution is correct.
>> hw6
Homework 6 Grader
Type the number of the problem that you would like to check
or choose the last option to check all problems and compute
a score and a submission code. (Nothing is submitted.)
0. EXIT
1. neighbor
2. replace_me
3. halfsum
4. large_elements
5. one_per_n
6. approximate_pi
7. separate_by_two
8. divvy
9. square_wave
10. myprime
11. ALL PROBLEMS (gives score and submission code)
Your selection: 11
Grading all problems ...
Problem 1 (neighbor):
Feedback: Your function performed correctly for argument(s) [1 2 3 4]
Feedback: Your function performed correctly for argument(s) [2 1]
Feedback: Your function performed correctly for argument(s) [1 -2 3]
Feedback: Your function performed correctly for argument(s) [8 -3 3 -5 1 -6 -8 -1 7 -2]
Feedback: Your function performed correctly for argument(s) [0.891424671420177 0.110591460888063 0.387170900099125 0.253843788797242 0.452254471901518 0.166431489478154 0.932147364807933 0.223318325589629 0.0984268686900553 0.353520286969166 0.488631127840917 0.20318518569997 0.989441807798946 0.430401071340604]
Feedback: Your function performed correctly for argument(s) [1 2;3 4]
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) []
Feedback: Your function performed correctly for argument(s) zeros(1,0)
Your solution is correct.
Problem 2 (replace_me):
Feedback: Your function performed correctly for argument(s) [1 2 3], 2, 4, 5
Feedback: Your function performed correctly for argument(s) [1 2 3], 4, 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4], 5, 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5], 6
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10], 2, 2
Feedback: Your function performed correctly for argument(s) [-2 -4 -1 -2 -1 -5 -1 -2 -2 -2 -4 -5 -3 -3 -1], -2
Feedback: Your function performed correctly for argument(s) [1 1 -1 -1 1 -1 1 1 1 0 1 1 1 -1 1 1 -1 0 0 0], 0, 8, 8
Your solution is correct.
Problem 3 (halfsum):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10]
Feedback: Your function performed correctly for argument(s) [1;2;3;4;5;6;7;8]
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9]
Feedback: Your function performed correctly for argument(s) [6 10 1 1 7;1 3 4 4 1;1 6 8 6 1;1 9 6 2 1;4 3 2 4 6]
Feedback: Your function performed correctly for argument(s) [0.176096965497883 0.654159505385576 0.43017640385498 0.394581939467124 0.951985782991797 0.129182196885905 0.416640945800178 0.531029604185321 0.568692791329085 0.719048028658963 0.127623416818911 0.835350461328278;0.764538226361978 0.765373227521929 0.675946088557486 0.473769946869344 0.471277977678831 0.12241513792208 0.340915324884967 0.138492200282524 0.671503585989359 0.834264538109086 0.618037016165269 0.978937020991224;0.719112286094527 0.989519534988798 0.473231517307113 0.66583340987608 0.103462412135709 0.291149431051823 0.627061220282097 0.778820321334405 0.736324854337908 0.42120001576177 0.917100855398257 0.0675020536247704;0.202463092764134 0.903198227804808 0.596455588137084 0.649654727218335 0.740401705008778 0.614889352736 0.924307136520583 0.499348158063849 0.696828576371973 0.409953224239685 0.717868103959419 0.593911879975349;0.280384804882256 0.734168850407162 0.960112121913415 0.907969942772756 0.154383789374087 0.853991462172677 0.463382672796254 0.479744457946739 0.766305854715115 0.812556952189781 0.696714024452422 0.294971002467269;0.78938463333615 0.673902594744981 0.144389365459141 0.738145399764985 0.864911783053234 0.37541017527314 0.760646968405647 0.262742554391831 0.394295803589881 0.511605662978628 0.523280478282449 0.405137239554395;0.185039538649014 0.821321258769617 0.444561404330805 0.203559739634278 0.698354322253204 0.414459659338655 0.17227321998115 0.247327658846348 0.428446100031067 0.327818542106276 0.688037997077008 0.513847964677426]
Your solution is correct.
Problem 4 (large_elements):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10]
Feedback: Your function performed correctly for argument(s) [10 9 8 7 6 5 4 3 2 1]
Feedback: Your function performed correctly for argument(s) [1 4;5 2;6 0]
Feedback: Your function performed correctly for argument(s) [6 7 8 3 8;6 5 10 1 5;5 7 4 5 7;6 6 8 4 4;1 1 6 7 1]
Feedback: Your function performed correctly for argument(s) [15.3176592389644 1.61097477738744 9.11868646266657 0.340740945207039 3.18055312838712 6.83909544830505;17.7988025118303 18.1013059008894 19.7084577766845 16.9925854818723 5.20462935030034 12.2786239916774;6.17294740982631 9.32011123623242 15.505619664882 11.0691499865279 13.3999200357944 2.73057982301504]
Your solution is correct.
Problem 5 (one_per_n):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) 3
Feedback: Your function performed correctly for argument(s) 4
Feedback: Your function performed correctly for argument(s) 8
Feedback: Your function performed correctly for argument(s) 9
Feedback: Your function performed correctly for argument(s) 9.7875
Feedback: Your function performed correctly for argument(s) 9.7876
Feedback: Your function performed correctly for argument(s) 9.7877
Feedback: Your function performed correctly for argument(s) 9.36347732314096
Feedback: Your function performed correctly for argument(s) 9.37115422278818
Feedback: Your function performed correctly for argument(s) 9.87632869803532
Feedback: Your function performed correctly for argument(s) 9.03924032770895
Feedback: Your function performed correctly for argument(s) 9.30329034534588
Feedback: Your function performed correctly for argument(s) 10
Your solution is correct.
Problem 6 (approximate_pi):
Feedback: Your function performed correctly for argument(s) 0.1
Feedback: Your function performed correctly for argument(s) 0.01
Feedback: Your function performed correctly for argument(s) 0.001
Feedback: Your function performed correctly for argument(s) 1e-05
Feedback: Your function performed correctly for argument(s) 1e-08
Feedback: Your function performed correctly for argument(s) 1e-10
Feedback: Your function performed correctly for argument(s) 1e-14
Feedback: Your function performed correctly for argument(s) 1e-15
Feedback: Your function performed correctly for argument(s) 1e-16
Feedback: Your function performed correctly for argument(s) 1
Your solution is correct.
Problem 7 (separate_by_two):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) [1;2]
Feedback: Your function performed correctly for argument(s) [1;2;3;4;5;6;7;8;9;10]
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9]
Feedback: Your function performed correctly for argument(s) [6 4 7 4 2;3 1 6 3 10;10 8 3 1 2;8 1 5 9 8;2 1 2 10 1]
Feedback: Your function performed correctly for argument(s) [53 98 43 11 6 38 82 69;99 88 92 1 94 75 10 91;87 4 16 1 84 36 81 97;70 44 21 78 1 65 7 45;63 26 24 76 65 75 88 86;66 20 96 8 75 5 78 69;24 69 56 64 35 33 35 99;73 73 31 61 37 65 36 17;17 14 3 100 2 53 83 59;80 72 8 37 28 16 93 10;23 44 81 40 86 28 71 89]
Your solution is correct.
Problem 8 (divvy):
Feedback: Your function performed correctly for argument(s) [1 4;5 2;6 0], 3
Feedback: Your function performed correctly for argument(s) [1 2 3 4 5 6 7 8 9 10], 2
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9], 3
Feedback: Your function performed correctly for argument(s) [1 2 3;4 5 6;7 8 9], 3
Feedback: Your function performed correctly for argument(s) [19 9 6 11 18 4 16 2 3;19 16 8 13 14 15 8 11 10;15 12 13 1 3 7 11 20 12;9 13 7 12 3 19 2 10 10;16 15 10 20 19 7 1 9 1], 2
Your solution is correct.
Problem 9 (square_wave):
Feedback: Your function performed correctly for argument(s) 1
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) 10
Feedback: Your function performed correctly for argument(s) 100
Feedback: Your function performed correctly for argument(s) 1000
Feedback: Your function performed correctly for argument(s) 4378
Your solution is correct.
Problem 10 (myprime):
Feedback: Your function performed correctly for argument(s) 2
Feedback: Your function performed correctly for argument(s) 3
Feedback: Your function performed correctly for argument(s) 4
Feedback: Your function performed correctly for argument(s) 5
Feedback: Your function performed correctly for argument(s) 8
Feedback: Your function performed correctly for argument(s) 9
Feedback: Your function performed correctly for argument(s) 10
Feedback: Your function performed correctly for argument(s) 11
Feedback: Your function performed correctly for argument(s) 12
Feedback: Your function performed correctly for argument(s) 313
Feedback: Your function performed correctly for argument(s) 659
Feedback: Your function performed correctly for argument(s) 547
Feedback: Your function performed correctly for argument(s) 577
Feedback: Your function performed correctly for argument(s) 180683
Feedback: Your function performed correctly for argument(s) 242653
Your solution is correct.
Score: 100
しかし相変わらず、問題文がわかりにくい。
例えばこれ。
The function replace_me is defined like this: function w = replace_me(v,a,b,c). The first input argument v is a vector, while a, b, and c are all scalars. The function replaces every element of v that is equal to a with b and c. For example, the command >> x = replace_me([1 2 3],2,4,5); makes x equal to [1 4 5 3]. If c is omitted, it replaces occurrences of a with two copies of b. If b is also omitted, it replaces each a with two zeros.
こういう時はDiscussion Forumsで情報が見つかるからいいが…
また今週から始まったクラス"Computational Neuroscience"のWeek1も終了。これは人工知能というよりは、脳のメカニズムをシミュレーションする方法?を解説していくようだ。MATLABやPythonを使って解析をしていくようなので、これらの学習には使えそう。引き続きがんばって学習していこう。
【このカテゴリーの最新記事】
-
no image
-
no image
-
no image
-
no image
この記事へのコメント
コメントを書く
この記事へのトラックバックURL
https://fanblogs.jp/tb/3614337
※ブログオーナーが承認したトラックバックのみ表示されます。
この記事へのトラックバック