Solved


二乗になっている数を見つけよう
ある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。 例: 入力が a = [2 3 4] のとき、 出力 b は t...

6 years ago

Solved


ベクトルの値が増加しているかを調べよう
ベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。 例: 入力が x = [-3 0 7] のとき、 関数の...

6 years ago

Solved


チェッカーボードを作ろう
整数 n が与えられた時、以下の様な1と0を含むn×nの行列を作成しましょう。a(1,1) は1にする必要があります。 例: 入力 n = 5 出力 a が [1 0 1 0 1 0 1 0 1 0 ...

6 years ago

Solved


サイコロを作ろう
1から6までの独立かつランダムな数値を返すような関数を作成しましょう。 例: >> [x1,x2] = rollDice(); と入力すると x1 = 5 x2 = 2 のような解を返します。

6 years ago

Solved


ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
MATLABでは,角括弧の中に要素を入れることで、ベクトルを作成できる。 x = [1 2 3 4] また次のようにも書ける(コンマはオプション)。 x = [1, 2, 3, 4] 問題:次のベクトルを出力する関数を作成せよ。...

6 years ago

Solved


ベクトルのスケーリング
入力したベクトルの大きさを1にしてください。

6 years ago

Solved


Extracting data: Heart rate (pulse)
The resting heart rate for an average adult is 60 - 100 beats per minute. Assign row array heartExtracted with all values in row...

9 years ago

Solved


Narcissistic problem
How many likes has this problem?

9 years ago

Solved


Constructing column arrays
* Construct a column array elevatorStops with values 2, 4, 5, 9, and 10

9 years ago

Solved


Adding an element: Ticker tape
* Add stockPrice to the beginning of row array tickerTape

9 years ago

Solved


Function call in expression: Reduced pricing.
Write a single statement that assigns cartTotal with the discounted cost of items 1 and 2. Function DiscountedPrice will return ...

9 years ago

Solved


Column arrays: Transpose a row array
* Construct a row array countValues with elements 1 to endValue, using the colon operator. * Transpose countValues to result in...

9 years ago

Solved


Variable sized row arrays
* Reverse the contents of row array mileMarkers

9 years ago

Solved


Array resizing: Removing elements
* Remove elements 2, 4, and 6 from row array pendingTasks

9 years ago

Solved


Logic array: Identifying qualifying times
Create a logic array qualifyingIndex with true for any location where the runner is male with a running time less than 8.2. Row ...

9 years ago

Solved


Linear-spaced points array
* Construct a row array plotPoints with 5 values that are spaced linearly from lowValue to highValue. Ex: If lowValue is 1 and ...

9 years ago

Solved


Integer indexing array: Reverse subsets
Construct an indexing array copySubset so that the statement reversedOrder = origOrder(copySubset); results in a row array begin...

9 years ago

Solved


Concatenating arrays
* Assign studentIDs with concatenated row arrays groupA and groupB

9 years ago

Solved


Indexing the array: Moving values
Assume sampleReadings always contains three elements. * Shift the array contents one position to the left. * The rightmost ...

9 years ago

Solved


Element-wise division
* Assign row array weightKilo with the corresponding weight in kilograms. Use the following conversion: kg = lb / 2.2

9 years ago

Solved


Relational operators and row arrays: Overweight baggage
Create a logical indexing array overweightBaggage with true in each location where the corresponding baggageWeight is greater th...

9 years ago

Solved


Tree Height
Assign treeHeight with the tree height given the shadow length and angle of elevation. Simple geometry can compute the heigh...

9 years ago

Solved


Function definition: Volume of a pyramid
Define a function CalculatePyramidVolume with inputs baseLength, baseWidth, and pyramidHeight. The function returns pyramidVolum...

9 years ago

Solved


Double colon operator: Counting down
* Construct a row array countValues from startValue to endValue, elements decremented by -2 Ex: If startValue is 10 and end...

9 years ago

Solved


Multi-line comments
* Fix the syntax errors.

9 years ago

Solved


Integer indexing array: Shift left
Write a *single* statement that shifts row array attendanceValues one position to the left. The rightmost element in attendanceV...

9 years ago

Solved


Double colon operator: Increment by x
* Construct a row array countValues from 0 to 25, elements incremented by incrementValue. Ex: If incrementValue is 5, countVa...

9 years ago

Solved


Coordinate geometry
Assign pointsDistance with the distance between point (x1, y1) and point (x2, y2). The distance is calculated by: Distance =...

9 years ago

Solved


Indexing an array element
* Assign currentStudent with the second element of array testScores. _Reminder: Array indexing starts with 1._

9 years ago

Solved


Double colon operator: Counting up
* Construct a row array countValues from 1 to endValue, using the double colon operator. Ex: If endValue is 5, countValues s...

9 years ago

Load more