Feeds
已解决
Guess the number I'm thinking of (Part 1)
In this game you are competing against two other people to guess the number that I'm thinking of. I randomly choose an integer ...
6 months 前
已解决
Create a random vector of integers with given sum
Your task today is to write a function that returns a vector of integer numbers, between, and including, 1 and m, of which the s...
6 months 前
已解决
Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A; Output: A=(Aij),where each entry Aij is either...
6 months 前
已解决
Given n, create n random numbers such that their standard deviation is also n.
Given n, create n random numbers such that their standard deviation is also n.
6 months 前
已解决
Find the maximum number of decimal places in a set of numbers
Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not count...
6 months 前
已解决
Make roundn function
Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...
6 months 前
已解决
Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000
6 months 前
已解决
Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346
6 months 前
已解决
Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. http://en.wikipedia.org/wiki/Whole_numb...
6 months 前
已解决
MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9
6 months 前
已解决
MATLAB Basic: rounding III
Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8
6 months 前
已解决
MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9
6 months 前
已解决
MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8
6 months 前
已解决
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...
6 months 前
已解决
sum of non-primes
The sum of the non-primes no larger than 10 is 1+4+6+8+9+10=38 Find the sum of all the positive non-prime integers that do no...
6 months 前
已解决
subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.
6 months 前
已解决
surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...
6 months 前
已解决
Given a number N, find the smallest prime P>N
Given a number N, find the smallest prime P greater than N. For example: If N=10 then P=11. If N=13 then P=17.
6 months 前
已解决
area of an annulus
Given the diameter d of the inner circle of the annulus. Given length z of a chord of the outer circle of the annulus. This chor...
6 months 前
已解决
Create a Multiplication table matrix...
Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...
6 months 前
已解决
Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...
6 months 前
已解决
Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given number of...
6 months 前
已解决
Pi Estimate 1
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>
6 months 前
已解决
Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....
6 months 前
已解决
Roll the Dice!
Description Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. Example [x1,x2] = rollDice(...
6 months 前
已解决
Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to find the logical indices o...
6 months 前
已解决
Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...
6 months 前
已解决
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
6 months 前
已解决
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
6 months 前




