Resuelto


Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

3 meses hace

Resuelto


Binary Coder
Take an input number and print the binary value of this number.

3 meses hace

Resuelto


Count ones
Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

3 meses hace

Resuelto


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

3 meses hace

Resuelto


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

3 meses hace

Resuelto


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

3 meses hace

Resuelto


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

3 meses hace

Resuelto


02 - Vector Variables 5
_eVec_ = _Hello_ ( _eVec_ is a string, which is a vector of characters )

3 meses hace

Resuelto


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

3 meses hace

Resuelto


Given area find sides
In a right angle triangle given area 'A' one arm=x, another arm=2x then find the value of x. For example, area A=400 then ...

3 meses hace

Resuelto


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

3 meses hace

Resuelto


Celsius to Fahrenheit converter
Convert Celsius to Fahrenheit degrees.

3 meses hace

Resuelto


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

3 meses hace

Resuelto


Back to basics 19 - character types
Covering some basic topics I haven't seen elsewhere on Cody. Return the number of punctuation characters in the input variabl...

3 meses hace

Resuelto


"mirror" matrix
Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

3 meses hace

Resuelto


Compound Interest : Compounding Periods
Theorem : Compound Interest where, F : Future value at the end of n periods P : Present value r : Annual nominal rate n :...

3 meses hace

Resuelto


Grouped Frequency Distributions

3 meses hace

Resuelto


Simple Interest : Calculate time in years
Theorem : Simple Interest where; F : Future Value P : Present Value r : Annual simple interest rate (decimal) t : Time in...

3 meses hace

Resuelto


Which quadrant?
Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

3 meses hace

Resuelto


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

3 meses hace

Resuelto


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

3 meses hace

Resuelto


Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

3 meses hace

Resuelto


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

3 meses hace

Resuelto


Solve the set of simultaneous linear equations
Given this pair of simultaneous linear equations: 2x + 3y = 23 3x + 4y = 32 Find the solution set (x,y)

3 meses hace

Resuelto


What percentage?
Calculate the output c as the percentage of a on b for given a and b.

3 meses hace

Resuelto


Sum of first n positive integers
Given n, find the sum of first n positive integers Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these terms is 55

3 meses hace

Resuelto


Is my wife right?
Regardless of input, output the string 'yes'.

3 meses hace

Resuelto


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

3 meses hace

Resuelto


Negative Infinity
Round the given array a towards negative infinity.

3 meses hace

Resuelto


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

3 meses hace

Cargar más