The Five Infection (Boss Level)
Given a 3x3 matrix A, replace:
every value that is equal to five
every value that is directly adjacent to a five
with zero in...
4ヶ月 前
解決済み
Fives Begone
Given any sentence as an input value 'sentence', turn all fives into the letter X and return the improved sentence. Also, turn a...
4ヶ月 前
解決済み
Broken Clock
Create a function that outputs t, an inputted matrix time x, in hours and minutes (hr:min) unless the time contains a five. In t...
4ヶ月 前
解決済み
No Fives Permitted
Create a function that gives users an custom error message if the matrix A contains a five. The error message should say "No Fiv...
4ヶ月 前
解決済み
A Fiveless Factorial
Given a positive integer x, compute its factorial y, but exclude any muliplication by five if applicable.
4ヶ月 前
解決済み
Don't Sum a Five
Create a function that sums the first and last element of a muti-element vector unless the value of one of the elements is 5. Do...
4ヶ月 前
解決済み
Don't Include a Five (Part Two)
Given a vector A with at least one non-five, return vector B, with all fives excluded (not replaced by zeros).
4ヶ月 前
解決済み
Don't Include a Five
Given a vector A, return vector B with all 5s replaced with 0s.
4ヶ月 前
解決済み
High Five!
Write a function that takes a number x and returns y = 'High Five' if x is not equal to five. Return y = 'Denied' if the number ...
4ヶ月 前
解決済み
A Five Introduction
Write a function that takes a number x as an input and returns the same value as y, unless x = 5, in which case the function sho...
4ヶ月 前
解決済み
Calculate Inner Product
Given two input matrices, x and y, check if their inner dimensions match.
If they match, create an output variable z which cont...
4ヶ月 前
解決済み
What's size of TV?
Many people buy TV. Usually they ask about diagonal. But also important are width and height. Let's assume that all TV have rati...
4ヶ月 前
解決済み
Counting down
Create a vector that counts from 450 to 200 in increments of 10.
4ヶ月 前
解決済み
Rotate Matrix @180 degree
Rotate Matrix @180 degree
Example
A=[8 1 6; 3 5 7; 4 9 2], then answer would be
[2 9 4;...
4ヶ月 前
解決済み
Count up then down
Create a function that produces counting up from 0 up to n then down to 0
n=2 --> 0 1 2 1 0
n=3 --> ...
4ヶ月 前
解決済み
Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row.
This also applies...
Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...
Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...
4ヶ月 前
解決済み
Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer:
e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2
4ヶ月 前
解決済み
Transpose
Write a MATLAB script in order to convert a random length row vector (v) into a column vector.
4ヶ月 前
解決済み
Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x
e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]
4ヶ月 前
解決済み
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10
4ヶ月 前
解決済み
square root
Find the square root (y) of an input (x).