annotate general/numerical/matrix/mouter.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
parents |
db7f4afd27c5 |
children |
|
rev |
line source |
samer@4
|
1 function B=mouter(varargin)
|
samer@4
|
2 % mouter - Multidimensional outer product of multiple arrays
|
samer@4
|
3 % Index domain of result is the concatenation of the index domains
|
samer@4
|
4 % of the arguments, (with trailing 1s removed).
|
samer@4
|
5 %
|
samer@4
|
6 % mouter :: [Size1->A], [Size2->A] -> [[Size1,Size2]->A].
|
samer@4
|
7 % mouter :: [Size1->A], [Size2->A], [Size3->A] -> [[Size1,Size2,Size3]->A].
|
samer@4
|
8 % etc.
|
samer@4
|
9 B=1;
|
samer@4
|
10 for i=1:length(varargin)
|
samer@4
|
11 B=kron(varargin{i},B);
|
samer@4
|
12 end
|
samer@4
|
13 B=reshape(B,cell2mat(cellmap(@size1,varargin)));
|
samer@4
|
14
|