Solved


time of day
Calculate the time of day in days, hours, minutes or seconds passed since the beginning of the day, depending on the unit. The u...

4 years ago

Solved


Implement a ROT13 cipher
Replace each character in string s1 with the character that is shifted 13 positions from it (wrap back to the beginning if neces...

4 years ago

Solved


Break it up! Break it up!
You have N pennies. Write a Matlab script that will reveal how many different ways you can break up those pennies. For example...

4 years ago

Solved


Exponents in Factorials
It's time to get excited about numbers!!! Well, we're just dealing with factorials here, but it's still a good reason to get ex...

4 years ago

Solved


How Far Can You Throw Something?
As you probably learned in your high school physics class, throwing an object at a 45 degree angle will give you the maximum ran...

4 years ago

Solved


A (wrong) place for everything, and everything in its (wrong) place
You have an equal number of cups and balls, each labelled from one to N. You randomly place one ball in each cup. Determine th...

4 years ago

Solved


Exponentiation
Given 3 integers b,e,k; find -- mod(b^e,k)

4 years ago

Solved


Nonuniform quantizer as a piecewise constant function
Implement a nonuniform quantizer as the following piecewise function: y = -3.5, x < -3 y = -1.5, -3 &#8804; x < -1 y = ...

4 years ago

Solved


Self-Description
This is a simplified version of the <http://xkcd.com/688/ *xkcd comic* by the same name>. Simply return the angle (in degrees...

4 years ago

Solved


Numbers on 7-segment
This is a 7-segment: _ |_| |_| It's a 3-by-3 char matrix.It has made by 3 characters: '_' , '|' and ' ' (space...

4 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,...

4 years ago

Solved


James Bond film count
Twenty-three James Bond films have been produced, in the years 1962, 1963, 1964, 1965, 1967, 1969, 1971, 1973, ... 197...

4 years ago

Solved


What digit is it?
The function you are being asked to write will take three numbers (n,x,q) as input. The object of the function is to determine ...

4 years ago

Solved


Still more miles to go before I sleep
It's time for more odometer fun. Last problem, my car's odometer hit 56789. It's coming up on 111111 now, which (barring a maj...

4 years ago

Solved


Highest powers in factorials
This is the inverse of the problem <https://www.mathworks.com/matlabcentral/cody/problems/44747 Exponents in Factorials>. Inste...

4 years ago

Solved


Temperature Conversion Utility
There are a few problems on Cody regarding temperature conversion (C to K, C to F, F to C), but none include Rankine. Furthermor...

4 years ago

Solved


Find Logic 24

4 years ago

Solved


How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

4 years ago

Solved


Long-digit Subtraction
Suppose you need to subtract a very large integer from another integer. <http://www.mathworks.com/matlabcentral/cody/problems/56...

4 years ago

Solved


Factorial: Unlimited Size : java.math
This challenge is an application of java.math that allows unlimited precision calculations. The primary reference sites are <ht...

4 years ago

Solved


modular arithmetic
Given three integers a,b and c, find the remainder when a^b is divided by c. Here, a^b will be well beyond the largest 64 bit in...

4 years ago

Answered
how to use fzero is for loop?
How exactly will your f be defined if x(i) is not defined. Not sure what you want to do but, Try this - x(1)=10; for i=2:4 ...

4 years ago | 1

Answered
find the repeating numbers in order
%Given your first element isn't 0 a=[1,1,1,1,1,2,2,2,2,2,1,1,1,1,4,4,4,5,5,5,7,7,2,2,2,2]; a(diff([0 a])~=0)

4 years ago | 1

| accepted

Answered
I am having problems creating user defined function. Here is the code I used. When I run it, I am keep getting error in line two and Not enough input arguements
Call like this - [x,y] = torus(1,2) %single input/output [x,y] = torus([1 2 3], [2 3 4]) %array input/output or initialize j ...

4 years ago | 1

Solved


Outer product of multiple vectors
In tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional arra...

4 years ago

Answered
Using forloop and whileloop to find if a number has appeared repetitively
You can also use groupsummary but since you mentioned loops, here a way with for loop - Since the size of the groups differ, i...

4 years ago | 1

| accepted

Answered
Coordinates of each rectangular cell is required
You are defining C1X1 incorrectly (trying to fit 4 elements as 1) - x=zeros(1,5)+5; y=linspace(4,16,5); xx=x'; yy=y'; [XX,...

4 years ago | 1

| accepted

Answered
How do I create a function for returning a figure?
Example (replace data and labels accordingly) function y %xdata x=0:0.1:50; %ydata y=sin(x); figure(1) %initiate a figure ...

4 years ago | 1

| accepted

Solved


Usage of java.math : N Choose K with unlimited precision
Calculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allo...

4 years ago

Solved


Usage of java.math : Add, Multiply, Pow
This challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations. The primary ...

4 years ago

Load more