Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...
3年以上 前
解決済み
Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...
3年以上 前
解決済み
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input matrix, generate an output matrix that consists o...
3年以上 前
解決済み
Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next.
Example input:
x = [10 2];
Beginner's Problem - Squaring
Try out this test problem first.
Given the variable x as your input, square it by two and put the result in y.
Examples:
...
3年以上 前
解決済み
Max of a Vector
Write a function to return the max of a vector
03 - Matrix Variables 2
Make the following variable:
<<http://samle.dk/STTBDP/Assignment1_3b.png>>
A 9x9 matrix of zeros, but with the following v...
3年以上 前
解決済み
Finding an element in a vector
x is a vector of unknown length
your function should return the index of the first element in the vector that is greater than...