Community Profile

# ChrisR

##### Last seen: Today
3,244 total contributions since 2015

I teach courses in water resources and environmental fluid mechanics.

View all

Contributions in
View by

Solved

Print the largest eigenvalue of A(500)
Write a function that prints the largest eigenvalue of A(500), without any extraneous output. For a positive integer n, let A...

11 hours ago

Solved

Beat the test suite if you can :)
Solve this problem based on clues in the test suite.

3 days ago

Solved

Find the mean of a 2-D matrix after excluding elements of specified sub-matrix
You need to find the mean of a 2-D matrix after excluding elements which form an inner sub-matrix. e.g. If the input 2-D matrix ...

3 days ago

Solved

Determine the number of correct and incorrect answers
In a Multiple Choice Question Test, you are to sort out answer from 4 samples, one of them is correct answer. There are 50 quest...

3 days ago

Solved

Raise Matrix to Power
For a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.

3 days ago

Solved

Combination of Vectors
Return a combination of vectors x1, x2 based on y1, y2 per: x(j) = 0 if y1(j) < y2(j) x(j) = x1(j) if y1(j)...

3 days ago

Solved

Compute average gain for some bets.
Given a vector containg the odds of some events in decimal format (e.g., |odds=[1.3 2.5 1.5]| ) and a vector of the same dimensi...

3 days ago

Solved

Usage of varargout
This Challenge is to demonstrate usage of varargout. Output a cell array using varargout of magic squares of size 1 thru n. ...

4 days ago

Solved

ZigZag - 03
Given a matrix of any size, print its elements from the zigzag form of the matrix. For example, a=[1 2 3; 4 5 6; ...

5 days ago

Solved

ZigZag - 05
Given a matrix, print all its elements in the alpha form. For example - a=[16 2 3 13 5 11 10 8 ...

5 days ago

Solved

Connect Four - 02
Previous Problem <https://www.mathworks.com/matlabcentral/cody/problems/45354-connect-four-01> In addition to previous proble...

5 days ago

Solved

Find index of non empty cell array
This question aims to understand the characteristics of MATLAB programs. Educational problem. Please find non empty index of ...

5 days ago

Solved

Find the index of elements in a string vector
In the vector of v, find the index of elements specified by a. v = ["Lion","Koara","Elephant","Snake","Dog","Cat","Camel"]; ...

5 days ago

Solved

Find 0 in array
Given array find where there 0 is.

5 days ago

Solved

Possible Outcomes of American Roulette
The payout for American roulette can be calculated by: payout = (38/n)-1 where n is the number of squares the bet covers. ...

5 days ago

Problem

Identify Ruth-Aaron numbers
After Hank Aaron hit his 715th home run and passed Babe Ruth’s total of 714, Carl Pomerance noticed that the union of the prime ...

6 days ago | 3 | 7 solvers

Solved

Find the centroid of triangle
Imagine that you want to calculate the *centroid* of some _triangles_ given in matrix form. First the coordinates of the vertice...

6 days ago

Solved

Calculate triangle area
Imagine that you want to calculate the areas of some triangles given in matrix form. First the coordinates of the vertices of th...

6 days ago

Solved

Electric Potential Energy

7 days ago

Solved

What's for Lunch?
Given b choices of beverages, e choices of entrees, s choices of sides (take two different sides total) and d choices of dessert...

7 days ago

Solved

Rotate a matrix without using rot90
rotate the input square matrix by certain degrees (e.g. 270 or 450 etc.) without using rot90 or flip function. its an extension...

8 days ago

Solved

Determine if input is a perfect number
A <http://en.wikipedia.org/wiki/Perfect_number/ perfect number> occurs whent the sum of all divisors of a positive integer, exce...

8 days ago

Solved

Determine if given number is perfect
A number is <http://en.wikipedia.org/wiki/Perfect_number perfect> if it is equal to the sum of its factors, excluding itself. ...

8 days ago

Solved

Primes for Large N: 2^30, System Memory Limit
This Challenge is to further improve the "primes" function for speed/memory usage to the Limit of Cody Memory. The Matlab fun...

8 days ago

Solved

normalize group of numbers to integers
Hi guys! I have a group of 4 numbers x,y,z,w which comes from 4 integers multiplied with a common factor. [x,y,z,w] = c [i,j,k,...

8 days ago

Solved

Angle between two vectors
Given 2 pairs of _cartesian co-ordinates_, determine the angle between the 2 vectors formed by the _points_ and the _origin_. An...

9 days ago

Solved

Alias abs to asb
Create an alias of a built-in function name. Goal is to alias asb with abs for dyslexic typers. The test suite will be ...

10 days ago

Solved

Matrix Indexing
Given a matrix A and scalars r,c,i, find the product of two elements, with the first element located at row r and column c (doub...

10 days ago

Solved

Matrix convolution
A certain convolution step involves an elementwise multipication between two 3x3 matrices and taking the resulting sum of the el...

10 days ago

Solved

Stacking vectors into a matrix
Given a 4x1 vector a, and a 2x2 matrix b, create a matrix M in which the first 2 rows are each identical to a and the last two r...

10 days ago