03 - Matrix Variables 3
Make the following variable:
<<http://samle.dk/STTBDP/Assignment1_3c.png>>
A 10x10 matrix where the numbers from 1 to 100 ...
4年弱 前
解決済み
Divisors of an integer
Given a number N, return a vector V of all integers that divide N.
For example,
N = 10
Then
V=[1 2 5 10]
4年弱 前
解決済み
Count ones
Write a program to count number of ones (1s) in an integer variable input.
For example:
Input x=2200112231
output y=3
I...
4年弱 前
解決済み
persistant sum
There will be 9 tests for this problem.
In each test you will be provided with 2 integers n=[n1,n2],
where n2 is equal to t...
4年弱 前
解決済み
Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if
x = [1 2...
Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.
4年弱 前
解決済み
Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'.
Examples
x = [ 1...
Babylonian method
Calculate the square root of a given positive number a using the Babylonian method
(https://en.wikipedia.org/wiki/Methods_of_co...
4年弱 前
解決済み
Dice roll - opposite faces
For this problem, you will be provided with the values of a dice roll (regular six-sided dice). The number of dice will be at le...
All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...