github.com/gopherd/gonum@v0.0.4/integrate/quad/internal/genherm.m (about)

     1  % Copyright ©2016 The Gonum Authors. All rights reserved.
     2  % Use of this source code is governed by a BSD-style
     3  % license that can be found in the LICENSE file.
     4  
     5  clc
     6  clear all
     7  close all
     8  
     9  % Generate herm points
    10  min = 216;
    11  max = 216;
    12  fprintf('xCache = [][]float64{\n')
    13  for i = min:max
    14      [x,w] = hermpts(i);
    15      fprintf('{')
    16      for j = 1:i-1
    17         fprintf('%1.16e, ',x(j)) 
    18      end
    19      fprintf('%1.16e},\n',x(i)) 
    20  end
    21  fprintf('}\n')
    22  
    23  fprintf('wCache = [][]float64{\n')
    24  for i = min:max
    25      [x,w] = hermpts(i);
    26      fprintf('{')
    27      for j = 1:i-1
    28         fprintf('%1.16e, ',w(j)) 
    29      end
    30      fprintf('%1.16e},\n',w(i)) 
    31  end
    32  fprintf('}\n')