Gelöst


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

mehr als 5 Jahre vor

Gelöst


Sum Sum Sum!
Calculate the sum of the natural numbers from 1 to n

mehr als 5 Jahre vor

Gelöst


You never ask a lady her age
Instead you ask her to multiply her age by 10, then subtract any of the first nine multiples of 9 (9,18,...,81), and tell you th...

mehr als 5 Jahre vor

Gelöst


Add consecutive integer numbers
Given consecutive numbers, add the numbers *without using the sum command in MATLAB.*

mehr als 5 Jahre vor

Gelöst


Eye Squared
For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

mehr als 5 Jahre vor

Gelöst


Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|. Example: Input: a = 4; b = 7; c ...

mehr als 5 Jahre vor

Gelöst


Squares of odd numbers upto a given range
Find the squares of odd numbers upto a given range. If Given x=6 return y=(1^2,3^2,5^2) y=1,9,25 If Given x=5 retu...

mehr als 5 Jahre vor

Gelöst


Determine the perimeter of a three-quarter circle
If a circle has a diameter of x as an input value, then show the value of the perimeter of the three-quarter circle in output va...

mehr als 5 Jahre vor

Gelöst


geometric progression
I've modified my <http://uk.mathworks.com/matlabcentral/cody/problems/2800-arithmetic-progression previous program> so that it n...

mehr als 5 Jahre vor

Gelöst


arithmetic progression
I've written a program to generate the first few terms of <https://en.wikipedia.org/wiki/Arithmetic_progression arithmetic progr...

mehr als 5 Jahre vor

Gelöst


Namespace
Create a set of n variable names 'a_1',...,'a_n' The result should be a column oriented cell array of strings. Example inp...

mehr als 5 Jahre vor

Gelöst


Determine if input is divisible by three.
Given a positive integer, n, determine if n is divisible by 3. If yes, the function should output true. If no, false.

mehr als 5 Jahre vor

Gelöst


Basic commands - rounding
make a function which will round to integer, which is nearer to zero. Example x=[-2.5 2]; y=[-2 2];

mehr als 5 Jahre vor

Gelöst


Find hen's weight.
If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

mehr als 5 Jahre vor

Gelöst


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

mehr als 5 Jahre vor

Gelöst


square root
Find square root of given number

mehr als 5 Jahre vor

Gelöst


cube of number
find cube of number

mehr als 5 Jahre vor

Gelöst


square of a number
find square of a given number

mehr als 5 Jahre vor

Gelöst


Adding Numbers
Add the input numbers to the original.

mehr als 5 Jahre vor

Gelöst


Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

mehr als 5 Jahre vor

Gelöst


Getting the row and column location from a matrix
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to get <http://www.mathwo...

mehr als 5 Jahre vor

Gelöst


Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


Repeat The Components of Matrix
Repeat The components of a matrix so that the size of the output matrix is double to input matrix and components are repeated ne...

mehr als 5 Jahre vor

Gelöst


Angle difference between Hour Hand and Minute Hand of clock
*Calculate the difference of angles between Hour hand and Minute hand of clock* E.g. 1) At 12:00 Angle Difference = 0 deg...

mehr als 5 Jahre vor

Gelöst


Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'. Examples x = [ 1...

mehr als 5 Jahre vor

Gelöst


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

mehr als 5 Jahre vor

Gelöst


Are you in XY plane?
Take a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 0. Example...

mehr als 5 Jahre vor

Gelöst


Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

mehr als 5 Jahre vor

Gelöst


Rotate it!
Given a set of points, your aim is to rotate it by a given angle "theta" CCW (in 2d). The points are given in a matrix(x) of dim...

mehr als 5 Jahre vor

Mehr laden