Gelöst


Find the slope of a line that passes through two vectors
Given two vectors p1 and p2, return the slope of a line that passes through p1 and p2. Examples: Input [p1,p2] = deal([0,1],[...

mehr als 3 Jahre vor

Gelöst


Find unique number in input
Find value that occurs in odd number of input elements.

mehr als 3 Jahre vor

Gelöst


Draw a X
Given an input , create a square matrix of zeros with an X of ones. Ex. n = 3 drawX(3) [ 1 0 1 0 1 0 1 0 1 ] ...

mehr als 3 Jahre vor

Gelöst


step function

mehr als 3 Jahre vor

Gelöst


sign function

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


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]

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


Array of Ones
Create a 100 X 100 array of ones.

mehr als 3 Jahre vor

Gelöst


Matrix to column conversion
Given a matrix of any size, convert it into a column vector. e.g A=[10 20 30; 40 50 60] then, B = [10; 40; ...

mehr als 3 Jahre vor

Gelöst


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

mehr als 3 Jahre vor

Gelöst


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


find "greatest common divisor" of two integer value
A function to find Greatest Common Divisor of two integer input E.G. x=-18 y=96 output should be +6 x=-18; y=96; >>your...

mehr als 3 Jahre vor

Gelöst


Babylonian method
Calculate the square root of a given positive number a using the Babylonian method (https://en.wikipedia.org/wiki/Methods_of_co...

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


Rotate counterclockwise a matrix 90 deg with left-bottom element
Example: Input [ 1 2 3 4 5 6 ] Output [ 3 6 2 5 1 4 ]

mehr als 3 Jahre vor

Gelöst


Minkowski distance

mehr als 3 Jahre vor

Gelöst


Return longest string in 1-D array of strings
Find the longest string in an array of strings. Return an empty string if the initial array is empty. If there are multiple stri...

mehr als 3 Jahre vor

Gelöst


Sort vector by number of prime factors of each element
Sort a given array based on how many prime factors each term has. Sort from least to greatest and output original values. Ex: ...

mehr als 3 Jahre vor

Gelöst


Find the number of primes leq than input
Given an integer n, determine the number of primes less than or equal to n.

mehr als 3 Jahre vor

Gelöst


Random Problem14 - Multiply a vector by a scalar of 2
Multiply a vector by a scalar of 2

mehr als 3 Jahre vor

Gelöst


RandomProblem13-Cube a number
Cube a number

mehr als 3 Jahre vor

Gelöst


Add the number of horizontal and vertical movements to each matrix element
Given n, create a square matrix and with element (1,1) = 1, add 1 to each element for each horitizonal and vertical movement. E...

mehr als 3 Jahre vor

Gelöst


Remove Lower Case Letters
Example MEMOry --> MEMO IMPlEMeNtATiON --> IMPEMNATON

mehr als 3 Jahre vor

Gelöst


Remove Upper Case Letters
Example Matlab --> atlab proBlem --> prolem Enter --> nter

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Mehr laden