% % MATLAB for DUMMIES 11-12 % % Script de test pour le probleme 3 % % function matlab3() clear all; close all; [x y z] = canoe(0.05); ax = axes('Visible','off',... 'PlotBoxAspectRatio',[450 350 450],... 'DataAspectRatio',[1 1 1],... 'CameraViewAngle',6); view(ax,[41 -42]); hold(ax,'all'); surf(x,z,y,'Parent',ax,'BackFaceLighting','unlit',... 'FaceColor',[1 0 0],'LineStyle','none'); light('Parent',ax,'Position',[1 0 0]); light('Parent',ax,'Position',[10 4 3]); end function u = b(t,T,j,p) i = j+1; if p==0 u = (t>= T(i) & t < T(i+p+1)); return end u = zeros(size(t)); if T(i) ~= T(i+p) u = u + ((t-T(i)) / (T(i+p) -T(i))) .* b(t,T,j,p-1); end if T(i+1) ~= T(i+p+1) u = u + ((T(i+p+1)-t) ./ (T(i+p+1) -T(i+1))) .* b(t,T,j+1,p-1); end end