Find last zero for each column
Given a numeric array of arbitrary size, return the row index of the last zero for each column. If a column contains all nonzero...
Skip by a multiple
Given an integer create an array of its multiples. Array must have a length of 15
約6年 前
解決済み
Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example
start with x = 1 and y = 3
end with y = 1 and x = 3
Do NOT simply r...
Hard limit function
Classify x data as
if x>=0 then y=1
if x<0 then y=0
Example
x = [ -2 -1 0 1 2]
y = [ 0 0 1 1 1]
約6年 前
解決済み
Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix
Example
...
Product of Each Column
Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...
Remove the positive integers.
Given array,x, remove all the positive numbers and display ouput as y.
Example x=[1 -2 3 -4] , output is y=[-2 -4].
約6年 前
解決済み
construct matrix with identical rows
Input a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x.
E...
約6年 前
解決済み
Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row.
Example if n =3 :
output is :
...
約6年 前
解決済み
Angle between Two Vectors
The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...
約6年 前
解決済み
Count from 0 to N^M in base N.
Return an array of numbers which (effectively) count from 0 to N^M-1 in base N. The result should be returned in a matrix, with ...
約6年 前
解決済み
Square Diagonal
If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.
約6年 前
解決済み
Find out magnitude of vector
Find out magnitude of vector.
Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2)
Please don't use sum function.
If you l...
Sum of the Multiplication of Vectors
Given the vectors x and y as input, multiply the vectors and return the summation of its elements.
Example:
x = [1 2 ...