Risolto


Test Problem; Create a 5x5 array containing all ones
This is a test for learning the process of creating a Cody problem. The goal of this test problem will be to create an array,...

quasi 9 anni fa

Risolto


Generate the sum of Squares of the given number
|P(n) = 1^2 + 2^2 + ... + n^2| |P(1) = 1| |P(2) = 1 + 4 = 5;| |P(3) = 5 + 9 = 14;| |P(4) = 14 + 16 = 30;|

quasi 9 anni fa

Risolto


MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

quasi 9 anni fa

Risolto


MATLAB Basic: rounding III
Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

quasi 9 anni fa

Risolto


Matrix FUN
Given a Matrix M, find out the number of elements of matrix that are divisible by 3. M = [1 2 3;4 5 6;7 8 9]; ou...

quasi 9 anni fa

Risolto


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

quasi 9 anni fa

Risolto


rounding numbers toward zero
round any number toward zero ex. 4.5=4 4.7=4 5.2=5

quasi 9 anni fa

Risolto


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

quasi 9 anni fa

Risolto


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

quasi 9 anni fa

Risolto


Back to Basics - Find no. of elements in a matrix?
Let A be a m*n matrix. Find the total no. of elements in A ? (Hint - formula based) A = [1 2 3;4 5 6]; output = 6

quasi 9 anni fa

Risolto


Find the Final State of an Abelian Sandpile
Let us define an <http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile> as a matrix that is only...

quasi 9 anni fa

Risolto


Your favourite city!
Type your favourite city.

quasi 9 anni fa

Risolto


Kaprekar numbers
Test if the input is a Kaprekar number: <http://mathworld.wolfram.com/KaprekarNumber.html>. Return a logical true or false. ...

quasi 9 anni fa

Risolto


UICBioE240 2.1
This will be useful later in the course, in conjunction to clc and clear all, what is the command to close all figure windows th...

quasi 9 anni fa

Risolto


UICBioE240 2.8
Convert x number of hours into seconds.

quasi 9 anni fa

Risolto


UICBioE240 2.2
Make a 3x4 matrix that contains all ones.

quasi 9 anni fa

Risolto


UICBioE240 2.10
Given a vector of numbers, give the difference between the maximum and minimum values.

quasi 9 anni fa

Risolto


Make a logical diamond using GALLERY function
Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/1078-make-a-diamond Problem 1078. Make a diamond> In thi...

quasi 9 anni fa

Risolto


Project Euler: Problem 8, Find largest product in a large string of numbers
Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

quasi 9 anni fa

Risolto


Moving target
Write a function with persistent variables currentLocationX and currentLocationY that store an object's location. Each call to t...

quasi 9 anni fa

Risolto


Twins in a Window
<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...

quasi 9 anni fa

Risolto


Function definition: Double down.
* Complete the DoubleDown function to return twice the initialValue.

quasi 9 anni fa

Risolto


The sum of individual numbers...
Well this one is taking a number and then summing the individual parts till you reach a value of 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0...

quasi 9 anni fa

Risolto


Is this number Munchhausen Narcissistic?
In this problem, simply return 1 if a supplied number is Munchhausen narcissistic or 0 if not. Example 153 is narcissistic...

quasi 9 anni fa

Risolto


While loop with branching
Write a while loop that adjusts userValue while userValue is less than 0 or greater than 80. If userValue is greater than 80, th...

quasi 9 anni fa

Risolto


While loop with multiple conditions
Write a while loop that multiplies userValue by 2 while userValue is not 10 and while userValue is less than 25.

quasi 9 anni fa

Risolto


UICBioE240 problem 1.9
Swap the first and last columns of a matrix. So if A = [12 4 7; 5 1 4]; B = [7 4 12; 4 1 5]; ...

quasi 9 anni fa

Risolto


Sort complex numbers into complex conjugate pairs
Sort complex numbers into complex conjugate pairs. Example: Input x = [3-6i -1-4i -1+4i 3+6i] Sorted output = [-1 - ...

quasi 9 anni fa

Risolto


Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

quasi 9 anni fa

Risolto


Forward Substitution
Solve a lower triangular linear set of equations as described in the following link: http://www.people.virginia.edu/~teh1m/cody/...

quasi 9 anni fa

Carica altro