Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [p] = spline(ponto)
- % paulogp
- % utilizacao de splines
- % Obter valores da tabela
- % m=csvread('spline_tabela.m');
- m = importdata('spline_tabela.m', '\t');
- % linha
- x = m(:,1)';
- f = m(:,2)';
- % splines
- p = spline(x, f, ponto);
- cs = spline(x, [0 f 0]);
- xx = linspace(0, 4, 30);
- % construcao do grafico
- plot(x, f, 'x', xx, ppval(cs,xx), '-');
- end
- % ficheiro: spline_tabela.m
- 0 0.0
- 1 1.5
- 2 0.5
- 3 0.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement