Advertisement
SilLAwNeD

Scilab, calcoef function

Oct 16th, 2018
1,044
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.49 KB | None | 0 0
  1. function [cc] = calcoef(T, y)
  2.     exec('**/cald.sci', -1)
  3.  
  4.     n = size(y, 1)
  5.     cc = zeros(n-1, n-1)
  6.     d = zeros(n, 1)
  7.     h = zeros(n-1, 1)
  8.     h2 = zeros(n-1, 1)
  9.     h3 = zeros(n-1, 1)
  10.     l = zeros(n-1, 1)
  11.    
  12.     d = cald(T, y)
  13.     h = T(2:n) - T(1:n-1)
  14.     h2 = h.*h
  15.     h3 = h.*h.*h
  16.     l = y(2:n) - y(1:n-1)
  17.    
  18.     cc(:, 1) = y(1:n-1)
  19.     cc(:, 2) = d(1:n-1)
  20.     cc(:, 3) = l./h2 - d(1:n-1)./h
  21.     cc(:, 4) = (d(2:n) - d(1:n-1))./h2 - 2 * l./h3
  22.    
  23. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement