A résolu


Create a random logical vector of N elements of which M are true.
Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

presque 11 ans il y a

A résolu


Lowest sum from a group of digits
Hi there. It's James's daughter here again, and my third grade math teacher is up to her old tricks. This time, she's giving u...

presque 11 ans il y a

A résolu


Pig Latin to English Translator
Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the <http://en.wikipedia.org/wiki/Pi...

presque 11 ans il y a

A résolu


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

presque 11 ans il y a

A résolu


Did you say please? - Find one string within another without strfind or regexp/regexpi
For a given string sentence, determine if the string word 'please' is present or not. If so, return the string 'OK', else return...

presque 11 ans il y a

A résolu


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

presque 11 ans il y a

A résolu


Consecutive Powers
Return 2 numbers and 2 powers such that their difference is 1 A 4 element row vector is expected: x where x(1)^x(2) - x(...

presque 11 ans il y a

A résolu


Relational operators: Guessing game
Row array userGuess contains a sequence of user guesses. Create a logical indexing array correctGuess with true in each location...

presque 11 ans il y a

A résolu


Slicing the cube
A bored matlab enthusiast has a cube with volume n^3. He decides to paint the entire surface of the cube red. Then, with slices...

presque 11 ans il y a

A résolu


Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.

presque 11 ans il y a

A résolu


Additive persistence
Inspired by Problem 2008 created by Ziko. In mathematics, the persistence of a number is the *number of times* one must apply...

environ 11 ans il y a

A résolu


Number Persistence
A number's persistence is the number of steps required to reduce it to a single digit by multiplying all its digits to obtain a ...

environ 11 ans il y a

A résolu


Remove the Zero
Given an array n, remove all zeros

environ 11 ans il y a

A résolu


Perl 3: shift
_This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab?_...

environ 11 ans il y a

A résolu


interesting center of magic matrix
output the centre of magic matrix of n input=7; output=25

environ 11 ans il y a

A résolu


Matlab Basics - Create a row vector
Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

environ 11 ans il y a

A résolu


Flipping
Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

environ 11 ans il y a

A résolu


Matlab Basics - Sum a vector
Write a script to add up all the elements in a vector e.g. x = [1 2 3 4] --> output = 10

environ 11 ans il y a

A résolu


Replacing a row
For matrix G=[1 2 3; 4 5 6; 7 8 9] Replace the 2nd row with 8s **remember to create matrix G

environ 11 ans il y a

A résolu


Logic variables
* Assign isAvailable with true.

environ 11 ans il y a

A résolu


Add 7
Given an input variable x, output a variable y that is 7 greater than x. Example: Input x = 1 Output y is 8 Input ...

environ 11 ans il y a

A résolu


Vector Magnitude Calculator
'a' is a vector that starts at the origin and ends at (x, y). Find ||a||. Hint: It is as simple as "ABC".

environ 11 ans il y a

A résolu


Append two matrix as shown below example
Append two matrix as shown below example A=[1 2; 3 4] and B=[5 6;7 8] Answer must be 1 2 5 6 3...

environ 11 ans il y a

A résolu


Accessing elements on the diagonal
Access the diagonal elements of a matrix without 'diag' function

environ 11 ans il y a

A résolu


Convert Fahrenheit to Celsius
Calculate the Celsius temperature C given the Fahrenheit temperature F. Examples: Input F = 90 Output C is 32.22 I...

environ 11 ans il y a

A résolu


Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

environ 11 ans il y a

A résolu


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

environ 11 ans il y a

A résolu


If-then-else
Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

environ 11 ans il y a

A résolu


Is My Wife Wrong?
Answer the question. (see also <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right Problem 149: Is my ...

environ 11 ans il y a

A résolu


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

environ 11 ans il y a

Charger plus