Community Profile # ChrisR

Last seen: 3 days ago Active since 2015

I teach courses in water resources and environmental fluid mechanics.

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

Solved

Alternative Dimensions
Given a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, giv...

2 days ago

Solved

make histogram
You probably know the function hist(x,n) to get the histogram. Now try to write the function yourself! For the cheaters wanting...

3 days ago

Solved

Flip the diagonal values
Write a program that flip the elements of main diagonal , upper and lower diagonal values of a sqare matrix. For example if a ...

3 days ago

Solved

Float like a cannonball
Given gravity on earth (g=9.81 [m/s/s]) find the distance s [m] by a cannonball propelled at a speed of u [m/s] from the origin ...

4 days ago

Solved

Find the right x in a 1. order Polynomal (y = m*x+c)
Given two points in a Cartesian coordinate system, find the x-value, where polynomial of 1. order (y = m*x+c) is equal to a giv...

4 days ago

Solved

Spiral Matrix
for a given integer n>=3, generate a matrix of nxn such that the value n^2 is at bottom left and its decreasing towards center ...

4 days ago

Solved

Generalized Fibonacci
The Fibonacci sequence is defined as: Fib(1) = 0 Fib(2) = 1 Fib(N) = Fib(N-1) + Fib(N-2) The Fibonacci sequence ca...

4 days ago

Solved

Form Blocks in a 1D array
Lets say I have an array of size (10,1); I want to divide it into the num number of blocks which are given by user no_of_b...

5 days ago

Solved

Number of lattice points within a circle
Find the number of points (x,y) in square lattice with x^2 + y^2 =< n. This is related to Jame's <http://www.mathworks.com/matla...

6 days ago

Solved

Five Fingers
A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

6 days ago

Solved

Insert certain elements into a vector.
We start with vector V. Some values W will be inserted into V, at positions U. Say, |V| contains |[1 2 3 4 5]| and |W| is |[0...

9 days ago

Solved

Get input and output variable names
Given a string representing a function header, return the variable names used for the inputs and outputs. For example if input ...

10 days ago

Solved

Siren frequency and Doppler effect.
The Doppler effect is described on OpenStax University Physics at https://openstax.org/books/university-physics-volume-1/pages/1...

11 days ago

Solved

Find names/words that start and end with the same letter.
Find names/words (from a string) that start and end with the same letter. * Case-insensitive. * If a name/word is not at the...

12 days ago

Solved

Soccer - TOTO
How many different outcomes are there in a soccer-TOTO with n games? For each game there are three results: win - loss - equa...

12 days ago

Solved

Simple Past of Regular Verbs
Given a regular verb, return the simple past. Example Input verb = 'to work' Output simple_past = 'worked'

12 days ago

Solved

What is Title of Cody Challenge 42?
Given a Cody Challenge number return its Title. *Input:* Cody Challenge Number *Output:* Title of the Cody Challenge ...

12 days ago

Solved

Kurchan 3x3 - Optimal Score
Find an optimal 3x3 Kurchan square, score of 198. A 3x3 Kurchan square has values 1:9.The products of each row, column, diag...

12 days ago

Solved

Script file size
Determine the file size of a script, "function.m". This is the base scoring method for Cody and the Matlab Contests. A met...

13 days ago

Solved

Magic - Faro Shuffle
The Faro shuffle is the perfect interweaving of cards. Quiz: How many Faro's returns a standard 52 deck to its start? Fifty fo...

13 days ago

Solved

Fifteen Parity Check
The Matlab function fifteen initializes the 4x4 array with randperm(16), which produces 50% unsolvable puzzles. A <https://en.wi...

13 days ago

Solved

Operate on matrices of unequal, yet similar, size
You may want to add a vector to a matrix, implying that the vector is added to each column of the matrix. Or multiply a 3x4x5 ma...

14 days ago

Solved

Pandigital Factors (Based on Euler 491)
A Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not hav...

14 days ago

Solved

Check if it is a square or cube of consecutive numbers
Check whether the element of given row vector is a square or cube of consecutive numbers. For example Input x=[4 27 16 25 ...

15 days ago

Solved

A sequence of Ones
You are given number(s) with all digits - 1. Your answer will depend on the count of 1 in the given number, for example - x1...

16 days ago

Solved

Create a function that adds one to a number
ex: x = 1 y = 2

16 days ago

Solved

create a function that cubes a number
example: x = 3 y = 27

16 days ago

Solved

Clockwise or Counterclockwise
Given a list of 2-d points defining the vertices of a polygon, determine whether these points are sorted clockwise. The input...

19 days ago

Solved

Best Fit RMS
Given a set of data as x and y, find the <http://en.wikipedia.org/wiki/Root_mean_square RMS> value between the data and its best...

19 days ago

Solved

Create a v-notch vector without "sort" function
Given a vector vec, create a v-shaped vector as shown below: vec = [ 10 2 3 89 5 7 90 0 12] Output vector = [90 89 12 10 7 5 3 ...

19 days ago