解決済み


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

2年以上 前

解決済み


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

2年以上 前

解決済み


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

2年以上 前

解決済み


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

2年以上 前

解決済み


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

2年以上 前

解決済み


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

2年以上 前

解決済み


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displayed ...

2年以上 前

解決済み


Sum the two halves of an array with an even number of elements
given an array of an even number of elements, sum the front and back half of the array and return the sums as an array For exam...

2年以上 前

問題


Sum the two halves of an array with an even number of elements
given an array of an even number of elements, sum the front and back half of the array and return the sums as an array For exam...

2年以上 前 | 0 | 40 個のソルバー

解決済み


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

2年以上 前

解決済み


Sum of series V
What is the sum of the following sequence: Σk(k+1) for k=1...n for different n?

2年以上 前

解決済み


Double all elements in the array
Duplicate all elements in the array

2年以上 前

解決済み


Sum of series III
What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

2年以上 前

解決済み


Find the max element of the array
Find the max element of the array

2年以上 前

解決済み


Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

2年以上 前

解決済み


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

2年以上 前

解決済み


the average value of the elements
Calculate the average value of the elements in the array

2年以上 前

解決済み


Sum of series II
What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

2年以上 前

解決済み


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

2年以上 前

解決済み


calculate the length of matrix
input 1 array, calculate the length

2年以上 前

解決済み


Convert radians to degrees
Given input in radians, output to degrees

2年以上 前

解決済み


Sum of series I
What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

2年以上 前

解決済み


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

2年以上 前

解決済み


Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.

2年以上 前

解決済み


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

2年以上 前

解決済み


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

2年以上 前

解決済み


Energy of a photon
&#9883 &#9762 &#9883 &#9762 &#9883 &#9762 &#9883 Given the frequency F of a photon in giga hertz. Find energy E of this photon...

2年以上 前

解決済み


Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

2年以上 前

解決済み


Subset Sum
Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. I...

2年以上 前

解決済み


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

2年以上 前

さらに読み込む