Gelöst


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

fast 4 Jahre vor

Gelöst


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

fast 4 Jahre vor

Gelöst


Matlab Basics II - squares
Write a function that takes matrix A, and squares each element in the matrix example: A = [1 2 3] output = [1 4 9]

fast 4 Jahre vor

Gelöst


Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column. Exa...

fast 4 Jahre vor

Gelöst


Simple Matrix
Make the following matrix without typing it in one by one. [1 2 3; 2 4 6; 4 8 12] x=[1 2 3].

fast 4 Jahre vor

Gelöst


Box
Give the volume of a box, x is equal to the body diagonal.

fast 4 Jahre vor

Gelöst


Problem for beginners
M is a nxm matrix. Swap the fist and the second last column with eachother. X=[1 2 3;4 5 6;7 8 9] Y=[2 1 3;5 4 6;8 7 9]

fast 4 Jahre vor

Gelöst


Stairs
Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...

fast 4 Jahre vor

Gelöst


Square
X is a number, write a code, where Y should be the square of X.

fast 4 Jahre vor

Gelöst


Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.

fast 4 Jahre vor

Gelöst


Matrix problem for beginners
Make a matrix [0,0,0;1,1,1;2,2,2]. X=[0,1,2]

fast 4 Jahre vor

Gelöst


Matrix for beginners
Multiply x and y elemwise.

fast 4 Jahre vor

Gelöst


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

fast 4 Jahre vor

Gelöst


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

fast 4 Jahre vor

Gelöst


Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

fast 4 Jahre vor

Gelöst


Equal to their cube
Tell me three real numbers that are equal to their cubes?

fast 4 Jahre vor

Gelöst


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

fast 4 Jahre vor

Gelöst


Evaluating a polynomial
Given the following polynomial and the value for x, determine y. y = 3x^5 – x^3 + 8x – 3 Example x = 1 y = 3 - 1 +...

fast 4 Jahre vor

Gelöst


Back to basics 25 - Valid variable names
Covering some basic topics I haven't seen elsewhere on Cody. Given a string, return true if it is a valid MATLAB variable nam...

fast 4 Jahre vor

Gelöst


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

fast 4 Jahre vor

Gelöst


Counting down
Create a vector that counts from 450 to 200 in increments of 10.

fast 4 Jahre vor

Gelöst


Complex number
For complex number c=a+bi, write code that will add a and b together.

fast 4 Jahre vor

Gelöst


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

fast 4 Jahre vor

Gelöst


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

fast 4 Jahre vor

Gelöst


Find max
Find the maximum value of a given vector or matrix.

fast 4 Jahre vor

Gelöst


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

fast 4 Jahre vor

Gelöst


Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...

fast 4 Jahre vor

Gelöst


Return area of square
Side of square=input=a Area=output=b

fast 4 Jahre vor

Gelöst


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

fast 4 Jahre vor

Gelöst


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

fast 4 Jahre vor

Mehr laden