Walsh matrix: Difference between revisions
J draft
imported>Maxima enthusiast No edit summary |
(J draft) |
||
Line 285:
{{out}}
[[File:Walsh matrices.png|thumb|center]]
=={{header|J}}==
<syntaxhighlight lang=J>kp1=: [: ,./^:2 */ NB. Victor Cerovski, 2010-02-26
walsh=: {{(_1^3=i.2 2)&kp1^:y 1}}
sequencyorder=: /: 2 ~:/\"1 ]</syntaxhighlight>
Small examples (time is not an issue here, but page estate is an issue):
<syntaxhighlight lang=J> walsh 0
1
walsh 1
1 1
1 _1
walsh 2
1 1 1 1
1 _1 1 _1
1 1 _1 _1
1 _1 _1 1
walsh 3
1 1 1 1 1 1 1 1
1 _1 1 _1 1 _1 1 _1
1 1 _1 _1 1 1 _1 _1
1 _1 _1 1 1 _1 _1 1
1 1 1 1 _1 _1 _1 _1
1 _1 1 _1 _1 1 _1 1
1 1 _1 _1 _1 _1 1 1
1 _1 _1 1 _1 1 1 _1
sequencyorder walsh 3
1 1 1 1 1 1 1 1
1 1 1 1 _1 _1 _1 _1
1 1 _1 _1 _1 _1 1 1
1 1 _1 _1 1 1 _1 _1
1 _1 _1 1 1 _1 _1 1
1 _1 _1 1 _1 1 1 _1
1 _1 1 _1 _1 1 _1 1
1 _1 1 _1 1 _1 1 _1</syntaxhighlight>
=={{header|Julia}}==
|