Community Profile

photo

jianrui fan


36 total contributions since 2019

jianrui fan's Badges

  • Commenter
  • Solver

View details...

Contributions in
View by

Solved


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

10 Tage ago

Solved


Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...

10 Tage ago

Solved


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

10 Tage ago

Solved


Max index of 3D array
Given a three dimensional array M(m,n,p) write a code that finds the three coordinates x,y,z of the Maximum value. Example ...

10 Tage ago

Solved


Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima. For example, x= [1 12 3 2 7 0 3 1 19 7]; ...

12 Tage ago

Solved


Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

12 Tage ago

Solved


Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] ...

12 Tage ago

Solved


Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

12 Tage ago

Solved


Count consecutive 0's in between values of 1
So you have some vector that contains 1's and 0's, and the goal is to return a vector that gives the number of 0's between each ...

12 Tage ago

Solved


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...

12 Tage ago

Solved


Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

16 Tage ago

Solved


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

16 Tage ago

Solved


Decimation - Optimized for speed
This problem is similar to http://www.mathworks.com/matlabcentral/cody/problems/1092-decimation, only this time the score will b...

16 Tage ago

Solved


Decimation
When dealing to the Roman Army, the term decimate meant that the entire unit would be broken up into groups of ten soldiers, and...

16 Tage ago

Solved


Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

27 Tage ago

Solved


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

27 Tage ago

Solved


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

27 Tage ago

Solved


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

27 Tage ago

Solved


Inner product of two vectors
Find the inner product of two vectors.

27 Tage ago

Solved


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

27 Tage ago

Solved


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...

27 Tage ago

Solved


04 - Scalar Equations 1
Define the variable a: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> Use this to calculate x: <<http://samle.dk/STTBD...

28 Tage ago

Solved


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

28 Tage ago

Solved


Connect Four Win Checker
<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

etwa ein Monat ago

Solved


How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

etwa ein Monat ago

Solved


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

etwa ein Monat ago

Solved


Implement simple rotation cypher
If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

etwa ein Monat ago

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

etwa ein Monat ago

Solved


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

etwa ein Monat ago

Solved


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

etwa ein Monat ago

Load more