Resuelto


Program an exclusive OR operation with logical operators
Program an exclusive or operation *without* using the MATLAB function xor. Use logical operators like |, &, ~, ... instead. ...

más de 7 años hace

Resuelto


Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

más de 7 años hace

Resuelto


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

más de 7 años hace

Resuelto


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

más de 7 años hace

Resuelto


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

más de 7 años hace

Resuelto


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

más de 7 años hace

Resuelto


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

más de 7 años hace

Resuelto


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

más de 7 años hace

Resuelto


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

más de 7 años hace

Resuelto


Multi-line comments
* Fix the syntax errors.

casi 8 años hace

Resuelto


Simple date to serial no. conversion
Convert a date string to a serial date number. For example if you take x='19-May-2001' then the result is 730990 x...

casi 8 años hace

Resuelto


Find number of days
The input is two date in string format (dd-mm-yyyy) find out the number of days between these two dates. Example: input: ...

casi 8 años hace

Resuelto


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

casi 8 años hace

Resuelto


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

casi 8 años hace

Resuelto


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

casi 8 años hace

Resuelto


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

casi 8 años hace

Resuelto


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

casi 8 años hace

Resuelto


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

casi 8 años hace

Resuelto


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

casi 8 años hace

Resuelto


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

casi 8 años hace

Resuelto


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

casi 8 años hace

Resuelto


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x=123045; x_vec=[1 2 3 0 4 5]; I happened upon a trick to do ...

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

alrededor de 10 años hace

Resuelto


Back to basics 14 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of all MATLAB keywords

alrededor de 10 años hace

Resuelto


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

alrededor de 10 años hace

Resuelto


pressure to dB?
given x ratio of pressure, find corresponding y dB

alrededor de 10 años hace

Resuelto


Back to basics 9 - Indexed References
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...

alrededor de 10 años hace

Resuelto


Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

alrededor de 10 años hace

Resuelto


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

alrededor de 10 años hace

Cargar más