Feeds
已解决
Sum of elements in a vector (★)
(copy of Prob. 3) Find the sum of all the numbers of the input vector x. Input x = [1 2 3 5] Output y is 11 <> ...
3 years 前
已解决
Colon operator of two vectors
You are given two vectors of equal length: VecStart, VecEnd Each vector contain a set of integers, where VecEnd(j)>=VecStar...
3 years 前
已解决
Remove the middle element from a vector
Remove the middle element of a vector? *Example:* [1,2,3] should return 2 [1,2,3,4] should return 2 [] should return...
3 years 前
已解决
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
The given function returns the index of the maximum value in a given matrix. such as X=[4,3,4,5,9,12,0,5] Ans= 6 if maxim...
3 years 前
已解决
Remove multiples of N
in the vector x remove all multiples of N. x = [1 2 3 4 5 6]; N = 2; Then y = [1 3 5];
3 years 前
已解决
Average of even-numbered columns
Given a vector, find the average of even-numbered columns. e.g x = [ 4 6 8 9 1 2 7 ] y = ( 6 + 9 + 2 ) / 3
3 years 前
已解决
A row vector, pick 1st number, skip 1,pick 3rd number, skip 2,pick,skip,etc then place all picked numbers in order in new vector
Having a row vector of number, pick the first number, place in new output vector as the first value, then skip one number, pick...
3 years 前
已解决
Replace all odd numbers with NaN
Replace all odd numbers in the vector or matrix with NaN. For example, if x = [1 3 4 5 8 11]; then return y = [NaN Na...
3 years 前
已解决
Vector indexing: lower than mean
Find indices of values in a vector lower than the mean of the vector
3 years 前
已解决
Returning a "greater than" vector
Given a vector, v, return a new vector , vNew, containing only values > n. For example: v=[1 2 3 4 5 6] n=3 vNew =...
3 years 前
已解决
Find Min and Max Differences in a Vector
Given an array of integers, return the absolute largest and smallest (non zero) difference between any two numbers in the array....
3 years 前
已解决
vector indexes for a matrix
Matlab allows us to use several indexing styles making code simpler and easier to read than using loops. Vectors can have ve...
3 years 前
已解决
Percentage of zeros in a matrix of only 1s and 0s
Write a function called _zero_stat_ that takes a matrix as an input that only has 0 and 1 elements. The function needs to comput...
3 years 前
已解决
Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...
3 years 前
已解决
Return median of a matrix
Compute median of a matrix of any dimension. Exclude the NaNs if any.
3 years 前
已解决
nxn matrix with elements from 1:n^2
really simple once you see what the matrix is supposed to look like. i appreciate what seems to be a clever approach to solving ...
3 years 前
已解决
Make combination of two given matrices.
Make a combination of the two given matrices as a given example. Example: input1 = [1 2 3; 4 5 6]; input2 = [7 8; 9 10...
3 years 前
已解决
Horizontal matrix sort
Given a matrix x with n rows and m columns, return a matrix y with n rows and 2m columns, such that every row in x is sorted fro...
3 years 前
已解决
Get the array of sum for three consecutive numbers in an array
Get the array of sum, for three consecutive numbers in an array. if Input 'x' does not have at-least 3 elements then 'y' shou...
3 years 前
已解决
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 years 前
已解决
Add a vector to a matrix
Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...
3 years 前
已解决
Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...
3 years 前
已解决
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...
3 years 前
已解决
Count number of words in string
Count number of words in string Examples 'hi', answer is 1 'hi hi', answer is 2 'I enjoy cody', answer is 3
3 years 前
已解决
Reverse a string
Reverse the given string. Example input = 'reverse' output = 'esrever'
3 years 前


