Answered

How to average over different length vectors without excessive for loops?

I would use a cell array. for k=1:100 x{k}=randi(100,1,randi(1000));%simulate your outputs end Mean=zeros(1,100); for k...

How to average over different length vectors without excessive for loops?

I would use a cell array. for k=1:100 x{k}=randi(100,1,randi(1000));%simulate your outputs end Mean=zeros(1,100); for k...

ungefär 21 timmar ago | 0

Solved

Fangs of a vampire number

A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such tha...

ungefär 23 timmar ago

Solved

Variance computation (★★★)

Given a vector x with several values, compute the variance, whose formula is given by: <<https://i.imgur.com/Wg95KBE.gif>> ...

ungefär 23 timmar ago

Solved

Make a list string

Given a cell string, produce a string separating the items with spaces and commas and with an 'and' preceding the final item, an...

ungefär 23 timmar ago

Solved

Wrap-around effect

In vector x of length n we define (n+1) position as going back to the first position (so called wrap-around effect). Can you ret...

en dag ago

Solved

Sample from random roulette

Given a list of values and their probabilities sample 10,000 values. Example: x = [1 2 3 4 5]; prob = [0.2 0.1 0.4 0....

en dag ago

Solved

Create a matrix with difference of each row of input matrix

With a given input matrix A, create a output matrix B in such a way that each row in B is a difference of rows of input matrix A...

en dag ago

Solved

The prisoner

"We want information, information, information." "Who are you?" Input can be a string or a number (array).

en dag ago

Solved

Concatenate strings

concatenate a variable number of input strings to produce one outputstring

en dag ago

Solved

Remove the middle element from a vector

Remove the middle element of a vector? *Example:* [1,2,3] should return 2 [1,2,3,4] should return 2 [] should return...

en dag ago

Solved

Find 100 from a Matrix and Replace With 0 with less computation time

pls use this matrix x = [208 40 167 180 112 70 192 215 90 19 231 100 9 100 97 100 ...

en dag ago

Solved

Logarithm with base other than 'e'

The standard log() function in Matlab returns the natural logarithm (base equal to Euler's constant). Compute the logarithm for ...

en dag ago

Solved

Parallel vectors

Return true or false depending on whether 2 vectors are parallel or not. Vectors can be 2 or 3 dimensional. The origin is not c...

en dag ago

Solved

Was ist denn los?

Nur für deutschsprechende Leute! Wie geht's? ...also gut, bis bald!

en dag ago

Solved

The answer to life the universe and everything

Write a function that gives the answer to life the universe and everything to every input except the input is 42. In this case t...

en dag ago

Solved

MiniMax

Find the smallest value in array, which is the maximum of its row and column. Example: in array shown below are two numbers w...

en dag ago

Solved

Find the index of the first occurrence of a value in a matrix

Given a matrix of scalars, find the first occurrence of -1 in each column. Output NaN for a column which does not contain the va...

en dag ago

Solved

Let's create histogram data by yourself.

We'd like to create histogram data, which first column shows the data, and second column shows the frequency. input = [1, 2, ...

en dag ago

Solved

Question 1

Implement a function named q1 with one input argument named n. This function should return the multiplication of all odd numbers...

en dag ago

Solved

determine amount cookies left

started with 3 cookies and you never ate any how many are left

en dag ago

Solved

Find supported functions

Given a function name, return true if that function is supported by the toolboxes that are installed with MATLAB on this machine...

2 dagar ago

Solved

Combination of Vectors

Return a combination of vectors x1, x2 based on y1, y2 per: x(j) = 0 if y1(j) < y2(j) x(j) = x1(j) if y1(j)...

2 dagar ago

Solved

Find the next state of a JK Flip-Flop

Find the next state (NS) of a JK Flip-Flop based on previous state (PS), inputs. Learn more about JK Flip-Flop theory here: ...

2 dagar ago

Solved

Find the Pattern

Find the pattern between input and output. Write a function that gives the correct output for any input. *Hint: magic*

2 dagar ago

Solved

Ordered pairs of integers (I, J).

Write a MATLAB function that calculates the number of ordered pairs of integers (I, J) that can be formed satisfying the conditi...

2 dagar ago

Solved

Number of o rderd pairs of integers (I,J) that can be formed.

Write a MATLAB function that calculates the number of ordered pairs of integers (I, J) that can be formed satisfying the condit...

2 dagar ago

Solved

NCHOOSEK - Time Optimization

*Input* * *V* —— Set of all choices, a vector of N, 1 < N < 100 * *K* —— Number of selected choices, a scalar, 0 <= K <=...

2 dagar ago

Solved

Find the position of planet in solarsystem

Write a funtion named *nthplanet* which takes name of the planet as input string and provides the position of the planet, starti...

2 dagar ago