# qixian wong

**Statistics**

**Cody**

**0** Problems

**115** Solutions

RANK**N/A**

of 250,230

REPUTATION**N/A**

CONTRIBUTIONS

**0** Questions

**0** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**0**

RANK

of 17,383

REPUTATION**N/A**

AVERAGE RATING**0.00**

CONTRIBUTIONS**0** Files

DOWNLOADS **0**

ALL TIME DOWNLOADS**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

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

2 months ago

Solved

We love vectorized solutions. Problem 1 : remove the row average.

Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

2 months ago

Solved

First non-zero element in each column

For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...

2 months ago

Solved

Getting the indices from a matrix

Inspired by Problem 645. Getting the indices from a matrix. Given a matrix A (or a vector), return the indices (always in row...

2 months ago

Solved

Getting logical indexes

This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

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

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

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

2 months ago

Solved

Sum all integers from 1 to 2^n

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

2 months ago

Solved

Magic is simple (for beginners)

Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

2 months ago

Solved

Make a random, non-repeating vector.

This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

2 months ago

Solved

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

2 months ago

Solved

Number of 1s in a binary string

Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

2 months ago

Solved

Return the first and last characters of a character array

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

2 months ago

Solved

Create times-tables

At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

2 months ago

Solved

Determine whether a vector is monotonically increasing

Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

2 months ago

Solved

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 months ago

Solved

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 months ago

Solved

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 months ago

Solved

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 months ago

Solved

Length of the hypotenuse

Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<https://i.imgu...

2 months ago

Solved

Unique values without using UNIQUE function

You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

2 months ago

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

2 months ago

Solved

Change the sign of even index entries of the reversed vector

change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

2 months ago

Solved

Set a diagonal

Given a matrix M, row vector v of appropriate length, and diagonal index d (where 0 indicates the main diagonal and off-diagonal...

3 months ago

Solved

Create a vector whose elements depend on the previous element

The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

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

3 months 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]; ...

3 months ago

Solved

Implement a bubble sort technique and output the number of swaps required

A bubble sort technique compares adjacent items and swaps them if they are in the wrong order. This is done recursively until al...

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

3 months ago