Answered

Fast calculation of short cumulative product vector

Nobody has followed Knut's suggestion: y(n) = y(n-1)*y(1) It is in fact a special case of Horner's Method for evaluating a...

Fast calculation of short cumulative product vector

Nobody has followed Knut's suggestion: y(n) = y(n-1)*y(1) It is in fact a special case of Horner's Method for evaluating a...

9 years ago | 0

Answered

alternative to log?

No matter what transformation you use, the result, prod(pi, i=1:n) --> 0, so eventually you will get underflow in fixed precisio...

alternative to log?

No matter what transformation you use, the result, prod(pi, i=1:n) --> 0, so eventually you will get underflow in fixed precisio...

9 years ago | 0

Answered

Loop unrolling question

Most of those manuals or books are out of date, or are unaware of the JIT compiler, or do not understand what the JIT compiler d...

Loop unrolling question

Most of those manuals or books are out of date, or are unaware of the JIT compiler, or do not understand what the JIT compiler d...

9 years ago | 0

Answered

Loop unrolling question

David, What you call _loop unrolling_ is not. Here is a rolled-up loop: for i = 1:n a(i) = b(i)*c(i) end ...

Loop unrolling question

David, What you call _loop unrolling_ is not. Here is a rolled-up loop: for i = 1:n a(i) = b(i)*c(i) end ...

9 years ago | 0

Answered

Why does 1 - 2/3 - 1/3 not equal zero?

Ned, Let me add to the confusion by asking 1. Why does |en1 = (1 - 2/3) - 1/3 = 5.5511e-017 = 2^(-54) = eps/2^2|? 2. Why does...

Why does 1 - 2/3 - 1/3 not equal zero?

Ned, Let me add to the confusion by asking 1. Why does |en1 = (1 - 2/3) - 1/3 = 5.5511e-017 = 2^(-54) = eps/2^2|? 2. Why does...

10 years ago | 1

Question

What does RANDPERM miss?

Abstractly, a random permutation generator (RPG) is a function that maps a random bit-string of length |b| into a permutation of...

10 years ago | 4 answers | 1

Answered

How to average only positive values in an array?

At the risk of offending the "vectorizers", the function below is 2 to 3 times faster than Jan's answer: function MeanP...

How to average only positive values in an array?

At the risk of offending the "vectorizers", the function below is 2 to 3 times faster than Jan's answer: function MeanP...

10 years ago | 0

Answered

MATLAB's accuracy of digits number

Here is a quotation from Prof Nick Trefethen FRS, Oxford: 11. _No physical constants are known to more than around eleven digit...

MATLAB's accuracy of digits number

Here is a quotation from Prof Nick Trefethen FRS, Oxford: 11. _No physical constants are known to more than around eleven digit...

10 years ago | 0

Answered

How do I write a good answer for MATLAB Answers?

An answer should _illuminate_ not _dazzle_.

How do I write a good answer for MATLAB Answers?

An answer should _illuminate_ not _dazzle_.

10 years ago | 2

Answered

random elements from specific rows in matrix

function rrelems = RandRowElems(A) % USE: m = 10; n = 10^6; % A = ceil(100*rand(m,n)); % tic;relems =...

random elements from specific rows in matrix

function rrelems = RandRowElems(A) % USE: m = 10; n = 10^6; % A = ceil(100*rand(m,n)); % tic;relems =...

10 years ago | 0

Question

What is the "best" way to Generate a Bernoulli Process?

A *Bernoulli Process* is a sequence of iid (independent, identically-distributed) random variables |x1,x2,...,xi,...|, where t...

10 years ago | 3 answers | 1

Answered

Profiler Paradox

In certain cases the profiler is worse than useless -- it is misleading. As you will have noticed, the profiler adds a lot of ov...

Profiler Paradox

In certain cases the profiler is worse than useless -- it is misleading. As you will have noticed, the profiler adds a lot of ov...

10 years ago | 0

Answered

Does MATLAB have a Birthday Problem?

Reply from Derek O'Connor: I must apologize for the omission of the RNG used. It was in my original draft but somehow got left ...

Does MATLAB have a Birthday Problem?

Reply from Derek O'Connor: I must apologize for the omission of the RNG used. It was in my original draft but somehow got left ...

10 years ago | 1

| accepted

Question

Does MATLAB have a Birthday Problem?

The Birthday Paradox or problem asks for the probability that in a room of n people, 2 or more have the same birthday (not date)...

10 years ago | 5 answers | 2

Answered

Can MATLAB draw graphs or networks with a regular structure?

Berk, Graph layout is a very difficult problem and has been studied for many years. AT&T has a department or section dedica...

Can MATLAB draw graphs or networks with a regular structure?

Berk, Graph layout is a very difficult problem and has been studied for many years. AT&T has a department or section dedica...

10 years ago | 1

Submitted

RPG Lab

A set of functions for generating and testing random permutations of the integers (1,2, ..., n).

10 years ago | 1 download |