Community Profile

# Lee Chih Jung

##### Last seen: Today
473 total contributions since 2020

View details...

Contributions in
View by

Solved

Reshape a Vector
Write a function that accept three inputs. The first one is a row vector S. The second and third arguments are m and n which de...

15 minutes ago

Solved

0<=x<=pi?
Check whether the given angle is between zero and pi. Return logical true or false.

24 minutes ago

Solved

Remove All elements less than 5
Given an input vector x, remove all elements of x less than 5 . Example: Input x = [ 1 2 5 7 3 ] Output y is [ 5 7 ...

25 minutes ago

Solved

Cumulative product of a vector
Cumulative product of a vector example x=[1 2 5 10], then answer must be [ 1 2 10 100] *If you like this prob...

36 minutes ago

Solved

Sum of unique multiples of 3 and 5
If we list all the natural numbers up to 15 that are multiples of 3 or 5, we get 3, 5, 6, 9, 10, 12 and 15. The sum of these mul...

42 minutes ago

Solved

Find the nearest prime
Given a positive integer 'n', the task is to find a prime number greater than or equal to 'n'. Example 1 If given 'n' is ...

1 hour ago

Solved

Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

1 hour ago

Solved

Negative matrix
Change the sign of all elements in given matrix.

1 hour ago

Solved

Construct a string from letters and counts
Given two input arrays like this: [5,3,1] ['a','b','c'] Output a string that contains each letter the specified num...

1 hour ago

Solved

Find Index of maximum Value and maximum Value of a vector
Find the Index of the first occurrence of the maximum value in a vector and also the maximum value in the vector. Example: [...

1 hour ago

Solved

Angle of triangle
For three unknown points a b c, given three sides ab bc ca, find three angles abc bca cab in radians. Your function should b...

1 hour ago

Solved

Wind outward from the center ...
Create an n-by-n matrix with elements ranging from 1 to n^2 in a rectangular spiral pattern. Example if n = 5 : 21 ...

2 hours ago

Solved

Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

2 hours ago

Solved

Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

3 hours ago

Solved

Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

3 hours ago

Solved

count upper and lower case characters
In a given input string, count and return the number of upper and lower case characters as u and l respectively. For example:...

11 hours ago

Solved

Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

13 hours ago

Solved

Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

1 day ago

Solved

Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

4 days ago

Solved

lb to kilogram
convert lb to kilogram units, easy

4 days ago

Solved

The answer to life the universe and everything
Write a function that gives the answer to life the universe and everything to every input except the input is 42. In this case t...

4 days ago

Solved

Sum two matrices
Take two incoming matrices, and sum them

4 days ago

Solved

Find the mean of two vectors
Take two vectors, and output the mean of them (bonus if you don't use the in-built mean function)

4 days ago

Solved

row removal
Remove the nth row from input matrix M and return the resulting matrix in output N.

4 days ago

Solved

Find the distance traveled by a car given velocity and time.
A car is traveling at a constant velocity for a specific amount of time. The function should use the two inputs, velocity and ti...

4 days ago

Solved

What percentage?
Calculate the output c as the percentage of a on b for given a and b.

4 days ago

Solved

Back to basics 17 - white space
Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable

4 days ago

Solved

Make an awesome ramp for a tiny motorcycle stuntman
Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

4 days ago

Solved

Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

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

7 days ago