Find the product of a Vector
How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?;
x = [1 : 0.5 : 6];
y ...
Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10.
For example, if you add the di...
4年弱 前
解決済み
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...
4年弱 前
解決済み
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...
4年弱 前
解決済み
Alternating sum
Given vector x, calculate the alternating sum
y = x(1) - x(2) + x(3) - x(4) + ...
4年弱 前
解決済み
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. ...
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...
4年弱 前
解決済み
Matlab Basics II - Intervals
Write a function that takes an interval from a to b, and divides it into 5 parts
example:
a = 1, b = 2
output = 1 1.25 ...
4年弱 前
解決済み
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]
4年弱 前
解決済み
Area of a circle
Given the radius x, y would be the area of a circle.
Pi = 3.1416
4年弱 前
解決済み
Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.
4年弱 前
解決済み
Try 1.5.4: Celsius to Fahrenheit
Write a program to convert an input given in Celsius to Fahrenheit.
Examples:
Input celsiusValue = 100
Output fahrValu...
4年弱 前
解決済み
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
4年弱 前
解決済み
Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.
4年弱 前
解決済み
Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input vector, output true or false whether it is a colu...
4年弱 前
解決済み
What percentage?
Calculate the output c as the percentage of a on b for given a and b.
Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once.
Example:
Input s ...
4年弱 前
解決済み
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...
4年弱 前
解決済み
Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as
|y = A.ⅇ^(-λt)*cos(2πft)|
where |A|, |λ|, and |f| ...