Solved


lucky
check whether n is a lucky number <https://oeis.org/A000959>

5 years ago

Solved


nanoseconds passed today
Calculate the amount of nanoseconds passed in the current day of a certain date string.

5 years ago

Solved


Function Iterator
Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

5 years ago

Solved


Renaming a field in a structure array
MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

5 years ago

Solved


Toeplitize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

5 years ago

Solved


Game of Nim
The Game of Nim is a famous studied 2 player strategy game. <http://en.wikipedia.org/wiki/Nim> There are 3 heaps, and you...

5 years ago

Solved


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

5 years ago

Solved


Twist 'n' Match
Given n and m, construct an n-by-n matrix a such that a, when rotated 90 degrees and compared with itself, matches itself in exa...

5 years ago

Solved


Find the Pattern
Find the pattern between input and output. Write a function that gives the correct output for any input. *Hint: magic*

5 years ago

Solved


Three grind is shipsstraigt
A function that returns either 'Rock', 'Scissors', or 'Paper' (string). You may succeed or you may fail the (case insensitive) t...

5 years ago

Solved


Remove the middle element from a vector
Remove the middle element of a vector? *Example:* [1,2,3] should return 2 [1,2,3,4] should return 2 [] should return...

5 years ago

Solved


Given a vector x, return vector y with all negative elements from the vector x.
Given a vector x, return vector y with all negative elements from the vector x if x has negative elements. Otherwise return 0. ...

5 years ago

Solved


square a number twice with square root of 4/5
square a number twice with square root of 4/5

5 years ago

Solved


Guess
A random number between 1 and 10 is created for the variable y. Guess what its value is.

5 years ago

Solved


Project Euler 249: Prime Subset Sums
Inspired by Problem 249 of Project Euler. <https://projecteuler.net/problem=249> Let S = {2, 3, 5, ...} be the set of prime ...

5 years ago

Solved


Find similar sequences
Another problem inspired by a question on the <http://www.mathworks.com/matlabcentral/answers answers> forum. Given a matrix ...

5 years ago

Solved


Generate Square Wave
Generate a square wave of desired length, number of complete cycles and duty cycle. Here, duty cycle is defined as the fraction ...

5 years ago

Solved


Hilbert numbers
Given a positive integer, n, return h as follows: 1. If n is not a <https://en.wikipedia.org/wiki/Hilbert_number Hilbert numb...

5 years ago

Solved


Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

5 years ago

Solved


Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example start with x = 1 and y = 3 end with y = 1 and x = 3 Do NOT simply r...

5 years ago

Solved


Matlab Basics II - Determine if an array has a 3rd dimension
For an array A, determine whether it has 3 dimensions, return 0 if x is only 2D, and 1 if x is 3D

5 years ago

Solved


Create an m x n array consisting only of an input value.
Create an array with m rows and n columns wherein all entries are assigned the input value x.

5 years ago

Solved


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

5 years ago

Solved


Bouncy numbers
Inspired by Project Euler n°112. * * Working from left-to-right if no digit is exceeded by the digit to its left it is call...

5 years ago

Solved


Polar Form Complex Number Entry
Write a function that takes the magnitude and angle(in degrees) of a complex number and returns a complex variable. Positive ang...

5 years ago

Solved


Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

5 years ago

Solved


Can you beat the lottery?
Well this one you may not get every time, but it is a lottery! Here is the code that generates the lottery numbers (you can try ...

5 years ago

Solved


Create all combinations of vectors
This function exists in the Neural Network Toolbox but is not available in Cody. Can you write such a function? See <http://...

5 years ago

Solved


"Power matrix" of two vectors
Given two row vectors x,y of lengths m and n (respectively), create an m x n matrix whose i,j entry is x(i)^y(j).

5 years ago

Solved


Does this dress make me look fat
For the input string "Does xyz make me look fat" output the string "No, xyz does not make you look fat"

5 years ago

Load more