MATLABでは,角括弧の中に要素を入れることで、ベクトルを作成できる。
x = [1 2 3 4]
また次のようにも書ける(コンマはオプション)。
x = [1, 2, 3, 4]
問題:次のベクトルを出力する関数を作成せよ。
x = [1 2 3 4 5 6 7 8 9 10]
参考:MATLABの コロン表記を使うと高速化できる。
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers601
Suggested Problems
-
Find the sum of all the numbers of the input vector
54155 Solvers
-
Longest run of consecutive numbers
6479 Solvers
-
Set some matrix elements to zero
625 Solvers
-
Fix the last element of a cell array
1761 Solvers
-
390 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!