Réponse apportée
Gaussian Distribution
This is really just plotting an equation, for practical purpose, you can plot from -4*sd to 4*sd. Let's say mu is the mean, ...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
non zero elements above 70 and below -70 zero
Use logical index x(x>70 | x<-70)=0

plus de 14 ans il y a | 0

Réponse apportée
Histogram Peak
You can use |findpeaks| function in Signal Processing Toolbox doc findpeaks

plus de 14 ans il y a | 0

| A accepté

A résolu


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

plus de 14 ans il y a

A résolu


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

plus de 14 ans il y a

A résolu


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

plus de 14 ans il y a

Réponse apportée
exponential random draws and the seed
What's your version of MATLAB? setGlobalStream is introduced in R2011a, try RandStream.setDefaultStream(s)

plus de 14 ans il y a | 0

Réponse apportée
making a function work
Maybe the path is messed up, what is 'ThePathName'? I'd suggest to put calc_avg on the path, then cd to the directory where the ...

plus de 14 ans il y a | 1

Réponse apportée
Using find command on each term in a vector
Not really a syntax for find, but take advantage of arrayfun a = -10:10; b = 22*rand(1,30)-11; c = arrayfun(@(x) find...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Preserve the methods of an object after it is updated
In your method AgentUpdate, don't use Obj. Just use AAA directly. Again, the way you wrote it now, Obj is a struct and when you ...

plus de 14 ans il y a | 0

| A accepté

A résolu


radius of a spherical planet
you just measured its surface area, that is the input.

plus de 14 ans il y a

A résolu


inner product of two vectors
inner product of two vectors

plus de 14 ans il y a

A résolu


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

plus de 14 ans il y a

A résolu


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

plus de 14 ans il y a

A résolu


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

plus de 14 ans il y a

A résolu


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

plus de 14 ans il y a

A résolu


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

plus de 14 ans il y a

A résolu


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

plus de 14 ans il y a

A résolu


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

plus de 14 ans il y a

A résolu


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

plus de 14 ans il y a

A résolu


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

plus de 14 ans il y a

A résolu


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

plus de 14 ans il y a

A résolu


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

plus de 14 ans il y a

A résolu


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

plus de 14 ans il y a

A résolu


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

plus de 14 ans il y a

A résolu


Is my wife right?
Regardless of input, output the string 'yes'.

plus de 14 ans il y a

A résolu


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

plus de 14 ans il y a

A résolu


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

plus de 14 ans il y a

A résolu


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

plus de 14 ans il y a

A résolu


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

plus de 14 ans il y a

Charger plus