Community Profile

photo

Justin Ng


Last seen: 4개월 전 2016년부터 활동

통계

  • Project Euler I
  • Scholar
  • Cody Challenge Master
  • CUP Challenge Master
  • Solver

배지 보기

Content Feed

보기 기준

문제를 풀었습니다


Check if a matrix is a palindrome in all directions
Check if a matrix is a palindrome both vertically and horizontally. You function will return *true* for |[1,2,1]| or |[2,7,2;...

6년 초과 전

문제를 풀었습니다


Matrix to 3-Column Matrix
Consider a matrix *A* such as A = [1 2 3 3 4 5 6; 2 3 4 5 6 7 8]; Can you convert this matrix to a three-column ...

6년 초과 전

문제를 풀었습니다


Crunch that matrix!
You are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms ...

6년 초과 전

문제를 풀었습니다


Vector to 3-Column Matrix
Consider a vector *A* such as A = [1 2 3 3 4 5 6] Can you convert this vector to a three-column matrix like this: ...

6년 초과 전

문제를 풀었습니다


Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

6년 초과 전

문제를 풀었습니다


Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

6년 초과 전

문제를 풀었습니다


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

6년 초과 전

문제를 풀었습니다


Go to the head of the class!
You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...

6년 초과 전

문제를 풀었습니다


Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

6년 초과 전

문제를 풀었습니다


Fill the Matrix - 2
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the me...

6년 초과 전

문제를 풀었습니다


Fill the matrix - 1
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the s...

6년 초과 전

문제를 풀었습니다


Replace secondary diagonal elements of a square array
Replace all the secondary diagonal elements of the square array A with the number n Example: A = [1 2 3 4 5 6 ...

6년 초과 전

문제를 풀었습니다


Divisible by n, prime divisors (including powers)
For this problem, you will be provided an array of numbers (not necessarily in order). Return the array of numbers with only pri...

6년 초과 전

문제를 풀었습니다


Divisible by n, prime vs. composite divisors
In general, there are two types of divisibility checks; the first involves composite divisors and the second prime divisors, inc...

6년 초과 전

문제를 풀었습니다


Oh Zero Zero Zero!!!
Hello all, So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...

6년 초과 전

문제를 풀었습니다


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

6년 초과 전

문제를 풀었습니다


Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

6년 초과 전

문제를 풀었습니다


Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

6년 초과 전

문제를 풀었습니다


Generate this matrix
Generate the following matrix. n = 2; out = [-4 -3 -2 -1 0 -3 -2 -1 0 1 -...

6년 초과 전

문제를 풀었습니다


Generate this matrix
For a given odd integer n, generate a matrix as follows: Input: n = 5; Output: [ 2 1 0 0 0 1 ...

6년 초과 전

문제를 풀었습니다


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

6년 초과 전

문제를 풀었습니다


Rainbow matrix
Create a "rainbow matrix" as described in the following examples Input = 3 Output = [ 1 2 3 2 3 2 ...

6년 초과 전

문제를 풀었습니다


How unique?
Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

6년 초과 전

문제를 풀었습니다


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

6년 초과 전

문제를 풀었습니다


Divisible by 11
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

6년 초과 전

문제를 풀었습니다


Divisible by 12
Write a function to determine if a number is divisible by 12. Similar to the number six, this can be done by checking for divisi...

6년 초과 전

문제를 풀었습니다


Divisible by 16
Write a function to determine if a number is divisible by 16. This can be done by a few different methods. Here are two: # If...

6년 초과 전

문제를 풀었습니다


Divisible by 15
Write a function to determine if a number is divisible by 15. If a number is <http://www.mathworks.com/matlabcentral/cody/proble...

6년 초과 전

문제를 풀었습니다


Divisible by 8
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

6년 초과 전

문제를 풀었습니다


Divisible by 6
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

6년 초과 전

더 보기