A résolu


Function definition: Volume of a pyramid
Define a function CalculatePyramidVolume with inputs baseLength, baseWidth, and pyramidHeight. The function returns pyramidVolum...

plus de 11 ans il y a

A résolu


Logical indexing: High scores
Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than 5...

plus de 11 ans il y a

A résolu


Concatenating arrays
* Assign studentIDs with concatenated row arrays groupA and groupB

plus de 11 ans il y a

A résolu


Column arrays: Transpose a row array
* Construct a row array countValues with elements 1 to endValue, using the double colon operator. * Transpose countValues to re...

plus de 11 ans il y a

A résolu


Find out magnitude of vector
Find out magnitude of vector. Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2) Please don't use sum function. If you l...

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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

plus de 11 ans il y a

A résolu


Integration after derivative
I am working on a model and there is an issue I cannot understand. To simplify look at this schematic. After you derive smth and...

plus de 11 ans il y a

A résolu


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

plus de 11 ans il y a

A résolu


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

plus de 11 ans il y a

A résolu


Proper Factors
Generate the proper factors of input integer _x_ and return them in ascending order. For more information on proper factors, ref...

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

plus de 11 ans il y a

A résolu


vector to string
Determine what the ASCII characters spell out. Example: input = [ 72 73 71 72] output = 'HIGH'

plus de 11 ans il y a

A résolu


Armstrong Number
Determine whether the given input n-digit number is Armstrong Number or not. Return True if it is an Armstrong Number. An n-D...

plus de 11 ans il y a

A résolu


Adding Cells with numbers defined as strings
Given a cell, with strings representing numbers, add each value. For example: a = {'9','33'}; the output should be: ...

plus de 11 ans il y a

A résolu


Test if a matrix is symmetric
Write a logical function that returns 1 if the input matrix is symmetric and 0 otherwise.

plus de 11 ans il y a

A résolu


Keep Only the Upper characters in a string
Keep Only the Upper characters in a string s = 'Sreeram Mohan'; output = SM;

plus de 11 ans il y a

A résolu


Find the mode of the given input
Find the statistical <http://en.wikipedia.org/wiki/Mode_(statistics)/ mode> of the given input. Example: If X is matr...

plus de 11 ans il y a

A résolu


Box!
Given a box, find the volume of the cube. With each side = a.

plus de 11 ans il y a

A résolu


Find out next state (NS) of T Flip-Flop.
Find out next state (NS) of T Flip-Flop based on previous state (PS), inputs. Learn more about T Flip-Flop theory here: <htt...

plus de 11 ans il y a

A résolu


Find the biggest empty box
You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

plus de 11 ans il y a

A résolu


Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

plus de 11 ans il y a

A résolu


Error handling
If the input is a negative number, generate an error. Otherwise, return the number.

plus de 11 ans il y a

A résolu


Divisors for big integer
Inspired by Problem 1025 and Project Euler 12. Given n, return the number y of integers that divide N. For example, with ...

plus de 11 ans il y a

A résolu


Ulam spiral 2: The revenge
Starting from the problem <https://www.mathworks.com/matlabcentral/cody/problems/2644-the-ulam-matrix>, transform the Ulam Matri...

plus de 11 ans il y a

A résolu


Function writing test
Tests your ability to write a trivial function.

plus de 11 ans il y a

A résolu


Change Vector Value
Change the element of the vector with respect to the element of the direction vector If the element of the direction vecto...

plus de 11 ans il y a

A résolu


Average speed for the entire trip
The input is two speeds (for the trip and return trip) and output is average speed. Assume units are consistent, say miles per h...

plus de 11 ans il y a

Charger plus