Question

Can You Explain This Weird Behavior

Weird Behavior I came across some weird behavior while writing an m-file. I have managed to isolate the problem as follows: ...

circa 4 anni ago | 2 answers | 1

Solved

Bleed non-zeros to the right

What a title! Yet, it says what I mean. You get a vector, some values and a lot of zeroes. Every zero is replaced by the firs...

circa 6 anni ago

Solved

What percentage?

Calculate the output c as the percentage of a on b for given a and b.

oltre 6 anni ago

Solved

CARDS PROBLEM

Read my mind and tell me the card number that I have now in my hands.

oltre 6 anni ago

Solved

Relative ratio of "1" in binary number

Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...

oltre 6 anni ago

Solved

factor to number

e.g. input number x=10 then it should produce y=25 or x=100 then y should be 2255. write a function or code to generate the same...

oltre 6 anni ago

Solved

Make a vector of prime numbers

Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

oltre 6 anni ago

Solved

Is the input divisible by 3?

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

oltre 6 anni ago

Solved

Volume and area of a sphere

Input(r) - radius Output([v,s]) - volume and area

oltre 6 anni ago

Solved

How many digits are there?

Input(s) - any string Output(n) - number of digits within string s

oltre 6 anni ago

Solved

Calculate the integral of the polynomial

for e.g. in = [3 2 1] out = [1 1 1 0]

oltre 6 anni ago

Solved

calculate linear convolution two vectors

for e.g in: a = [1 2 3] b = [4 5 6] out: y = [4 13 28 27 18]

oltre 6 anni ago

Solved

Number of odd and even elements within matrix

Input(m) - any matrix with integers Output(n) - n(1)=number of odd elements, n(2)=number of even elements Example: * m=...

oltre 6 anni ago

Solved

Find the minimum element of the matrix

Example: If x = [3 9; 5 2] then y = 2

oltre 6 anni ago

Solved

Temperature conversion

Convert temperature in degrees Celsius (C) to temperature in degrees Kelvin (K). Assume your answer is rounded to the nearest Ke...

oltre 6 anni ago

Solved

Can I make a right triangle ?

Input(a) - is vector with any amount of values. Interpreted as legths of sides. Output(b): * Is true if there are any 3 va...

oltre 6 anni ago

Solved

Calculate the derivative of a polynomial

Example: in = [ 1 1 1 ] out = [ 2 1 ]

oltre 6 anni ago

Solved

Vector of numbers divisible by 3

* Input(n) - any integer * Output(v) - vector with numbers divisible by 3(exept 0) starting from n to 0 Examples: * n=6...

oltre 6 anni ago

Solved

Sum the numbers on the main diagonal

Sum the numbers on the main diagonal of an n-by-n matrix. For input: A = [1 2 4 3 6 2 2 4 7]...

oltre 6 anni ago

Solved

Simple problem creating a function from an abstract specification.

MYSTERYFUNCTION3 This takes a vector of numbers v and computes a vector w such the w[i] is the average of v[i] and the previous...

oltre 6 anni ago

Solved

Procrustean bed

Given a vector x and an integer n, convert x to a vector of length n by (1) chopping off the end if it is too long, or (2) addin...

oltre 6 anni ago