Resuelto


Getting the indices from a matrice
Getting the indices from a matrice. Inspired by Problem 645. Getting the indices from a vector by the great Doug Hull. Given a...

alrededor de 10 años hace

Resuelto


Compute change
A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. Given amountToChange, ...

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


Finding values in arrays
Assign numMatches with the number of elements in userValues that equal matchValue. Ex: If matchValue = 2 and userVals = [2, ...

alrededor de 10 años hace

Resuelto


frame of the matrix
Given the matrix M, return M without the external frame.

alrededor de 10 años hace

Resuelto


Find and replaces spaces from a input string with *
For a given input string str, find how many spaces are there in the string and replace those spaces with * e.g. str = 'this is ...

alrededor de 10 años hace

Resuelto


commutative?
Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.

alrededor de 10 años hace

Resuelto


Set defaults
Write a function that computes the volume of a cube. The function should be able to accept three inputs: the length, width, and...

alrededor de 10 años hace

Resuelto


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

alrededor de 10 años hace

Resuelto


root?
* Given a function 'foo', and a position 'there', find the root near 'there'. * For example: If foo=@sin, and there=3.1, then r...

alrededor de 10 años hace

Resuelto


sinus function
x is the abscissa. find the absolute value of cosine of -x and the same value with changed sign.

alrededor de 10 años hace

Resuelto


Double Deal
*Description* Given an input vector _v_, return the first element as the first output, the second element as the second outpu...

alrededor de 10 años hace

Resuelto


2倍してみよう - ここからスタート!
初めにこの問題を試してみよう。 入力としてxを与え、それを2倍して結果をyに代入せよ。 Examples: Input x = 2 Output y is 4 Input x = 17 Output y is 34 ...

alrededor de 10 años hace

Resuelto


Matlab Basics II - Intervals
Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

alrededor de 10 años hace

Resuelto


Matlab Basics - Pick out parts of a vector
Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

alrededor de 10 años hace

Resuelto


Penny flipping - calculate winning probability (easy)
Two players are playing a fair penny flipping game. For each flip, the winner adds one penny from the loser's collection to his/...

alrededor de 10 años hace

Resuelto


Calculate distance travelled when given radius and rotations
When given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14

alrededor de 10 años hace

Resuelto


Calculate the height of an object dropped from the sky
Assume that an object is dropped from 1000 meters above the surface of the earth at time t=0. The object is dropped such that t...

alrededor de 10 años hace

Resuelto


Matlab Basics II - Free Fall
An object freely falling from rest under gravity covers a distance x given by: x = 1/2 gt^2 write a function that calculat...

alrededor de 10 años hace

Resuelto


Determine if input is a perfect number
A <http://en.wikipedia.org/wiki/Perfect_number/ perfect number> occurs whent the sum of all divisors of a positive integer, exce...

alrededor de 10 años hace

Resuelto


Populating an array with a for loop
Write a for loop to populate multiplicationTable with the multiples of baseValue from 0 to 5. Ex: If baseValue is 2, then mu...

alrededor de 10 años hace

Resuelto


Happy 2013...
Happy 2013, everyone! An interesting tidbit about 2013 is that it is the first year since 1987 to contain four different digits...

alrededor de 10 años hace

Resuelto


Matrix with different incremental runs
Given a vector of positive integers a (>=0); How does one create the matrix where the ith column contains the vector 1:a(i) poss...

alrededor de 10 años hace

Resuelto


Number of pennies
Complete the function ConvertToPennies() so that the function returns the total number of pennies given a number of dollars and ...

alrededor de 10 años hace

Resuelto


Multiply by 3
Given the variable x as your input, multiply it by three and put the result in y.

alrededor de 10 años hace

Resuelto


Cody Matlab Version
What is the current Cody Matlab Release? *Output:* string *Examples:* '(R2012a)' or 'R2012a' Hint: We have mo...

alrededor de 10 años hace

Resuelto


Make a simplified barcode
Given an integer to encode, make a barcode using the following encoding scheme: * The bar code is made from the binary versio...

alrededor de 10 años hace

Resuelto


Writing a recursive math function
Complete the recursive function RaiseToPower(). Ex: If userBase is 2 and userExponent is 4, then raisedValue is assigned wit...

alrededor de 10 años hace

Resuelto


Eight Queens Solution Checker
Write a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic <http://en.wikipe...

alrededor de 10 años hace

Resuelto


Writing a function: MaxValue()
Write a local function named MaxValue that returns the maximum of two inputs numA and numB.

alrededor de 10 años hace

Cargar más