Community Profile

# CHUANQIANG ZHANG

38 total contributions since 2019

View details...

Contributions in
View by

Trying to get matlab mex file to work
I had similar problem. I was running MATLAB 2019a under windows 10. To solve the problem, please try to run with Windows 7 co...

meer dan een jaar ago | 0

Solved

Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

meer dan een jaar 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.

meer dan een jaar ago

Solved

Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

meer dan een jaar ago

Solved

Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

meer dan een jaar ago

Solved

Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

meer dan een jaar ago

Solved

Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

meer dan een jaar 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...

meer dan een jaar 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...

meer dan een jaar 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...

meer dan een jaar ago

Solved

Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

meer dan een jaar ago

Solved

Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

meer dan een jaar ago

Solved

Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

meer dan een jaar ago

Solved

Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

meer dan een jaar ago

Solved

Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

meer dan een jaar ago

Solved

Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

meer dan een jaar ago

Solved

Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

meer dan een jaar ago

Solved

Given a and b, return the sum a+b in c.

meer dan een jaar ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

meer dan een jaar 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:...

meer dan een jaar ago

Solved

Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

meer dan een jaar ago

Solved

Tic Tac Toe FTW
Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

meer dan een jaar ago

Solved

Elapsed Time
Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

meer dan een jaar ago

Solved

Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

meer dan een jaar ago

Solved

Is my wife right?
Regardless of input, output the string 'yes'.

meer dan een jaar ago

Solved

Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

meer dan een jaar ago

Solved

Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

meer dan een jaar ago

Solved

Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

meer dan een jaar 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 ...

meer dan een jaar ago

Solved

Create a vector
Create a vector from 0 to n by intervals of 2.

meer dan een jaar ago