Replace all odd numbers with NaN
Replace all odd numbers in the vector or matrix with NaN. For example, if
x = [1 3 4 5 8 11];
then return
y = [NaN Na...
3年弱 前
解決済み
Create a "+" flag
Given two odd numbers, [m, n], return a matrix of size m x n which has all elements of the centre column and centre row set as 1...
3年弱 前
解決済み
odd number odd sum
How many three digit numbers are there whose sum of the digits is odd?
3年弱 前
解決済み
String Delimination and Outputting
In this problem, take an incoming string and deliminate the string based on spaces. Output the first string in between the space...
3年弱 前
解決済み
SAY 'OHYEAH'
Regardless of input, output the string 'OHYEAH'.
Find all prime factors of the input
Given an input x, find its all prime factors. Return the vector with all factors in ascending order.
Efficiency is the key here...
3年弱 前
解決済み
Sum of digits of powers of 2
Given n, first, calculate the number 2^n. Then, sum the digits that comprise that number. For example:
Input: n = 7
2^n = ...
All odd - all even
All odd numbers in x are added, while all even numers are subtracted from this.
example:
x = [1 2 3 4 5];
y = +(1+3+5)-...
3年弱 前
解決済み
More Simple String Concatenation
Take the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space a...
Simple String Concatenation
This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating t...
3年弱 前
解決済み
Add the positive numbers
Add only the positive numbers of x
example:
x = [-2 -1 0 1 2 3]
the positive numbers are: 1 2 3, so their sum is 6
Increment up an input vector
Increment up an input vector by adding the indices to the vector values. For example, if an input vector is [3, 2, 6, 1, 6], the...
3年弱 前
解決済み
Automatic String Editing
In this function, you will take an incoming string, and output the same string with each character one letter later in the alpha...
Decide whether determinant is zero.
Given a 3 x 3 matrix, find the determinant. Let y = true if the determinant is zero, and let y = false if the determinant is no...
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...