A résolu


Duplicate a character
Duplicate a character 'n' times. Example 1: str='a' n=5 output='aaaaa' Example 2: str='*' n=3 output='***'

plus de 11 ans il y a

A résolu


Reverse a matrix
Its simple. You have to reverse a given matrix.

plus de 11 ans il y a

A résolu


Related Vectors
I have two vectors A & B. If the values in vector A is zero then the corresponding value in vector B should be zero. Example:...

plus de 11 ans il y a

A résolu


Determine the square root
Determine the square root of the value the user has entered, n.

plus de 11 ans il y a

A résolu


Find the dimensions of a matrix
Just find the number of columns of the given matrix. Example x = [1 2 3 4 5 6] y = 2

plus de 11 ans il y a

A résolu


Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.

plus de 11 ans il y a

A résolu


Mode
Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

plus de 11 ans il y a

A résolu


Back to basics 2 - Function Path
Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Tricky timing
Write a function that takes between 0.5 seconds and 0.6 seconds to run.

plus de 11 ans il y a

A résolu


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the hourly wage times 40 and times 50, because annualSalary = hour...

plus de 11 ans il y a

A résolu


Area of a rectangle
Find the area of a rectangle with sides a and b

plus de 11 ans il y a

A résolu


times 5
Given the variable x as your input, multiply it by five and put the result in y.

plus de 11 ans il y a

A résolu


Declaring a character
* Assign middleInitial with the character T.

plus de 11 ans il y a

A résolu


Help the Patriots get to the Super Bowl
Given a football by the Patriots, return it to them with 2 psi less air in it. (The original psi is passed as a number to the...

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


prime test
find largest 2 digit prime number

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


Plus x: A first program
_Solve this problem in Mathwork's online Cody system._ Write a statement that assigns y with 5 plus x. Ex: If input x = 2,...

plus de 11 ans il y a

A résolu


Population growth
Assign finalPopulation with the population size given an initial population, population growth rate, and number of years. The fi...

plus de 11 ans il y a

A résolu


Computing wind chill
On a windy day, a temperature of 15 degrees may feel colder, perhaps 7 degrees. The formula below calculates the "wind chill," i...

plus de 11 ans il y a

A résolu


Compute total cost
A soda costs 2 dollars. A taco costs 3 dollars. Write a statement that assigns totalCost with the total meal cost given the numb...

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


Write an expression
Assigns finalResult with firstSample plus secondSample, squared, then divided by 3. Ex: If firstSample is 18 and secondSample is...

plus de 11 ans il y a

A résolu


Circle area using pi
Write a statement that assigns circleArea with the circle's area given circleRadius. Use the built-in mathematical constant pi. ...

plus de 11 ans il y a

A résolu


Assigning a sum
* Write a statement that assigns numCoins with numNickels + numDimes.

plus de 11 ans il y a

A résolu


Logic variables
* Assign isAvailable with true.

plus de 11 ans il y a

A résolu


Y=X
Given an input variable x, output a variable y that is equal in value to x. Example: Input x = 1 Output y is 1 Inp...

plus de 11 ans il y a

A résolu


Finding an element in a vector
x is a vector of unknown length your function should return the index of the first element in the vector that is greater than...

plus de 11 ans il y a

A résolu


Matlab Basics II - 3 Dimensional Arrays
Assume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), ...

plus de 11 ans il y a

Charger plus