bonjour ,
en fait je voulais vous poser une question j'ai une fonction (boot)
et je voudrais faire tourner cette fonction n fois par exemple , j'ai fais la boucle suivante mais ca ne marche pas :
merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 function y=iteration(x,n) %n nombred'itérations désirées %x vecteur des observations for i=1:n y=boot(4,x); y(i)=y end sachant que la fonction boot est la suivante : function[Output]=boot(k,In) % function[Output]=boot(k,In) % % Bootstrap resampling procedure for univariate (In) % input data. For an input vector the program generates % a bootstrap vector (of the size k), which elements are % the samples with replacement from the input vector. % For an input matrix it generates a bootstrap matrix % (of the same numbers of columns as the input one but % with k rows), which elements in columns are the samples % with replacement from the columns of the input matrix. % [s1,s2]=size(In); if s1==1, Output=In(fix(s2*rand(1,k)+1)); elseif s2==1 Output=In(fix(s1*rand(k,1)+1)); else ind=fix(s1*rand(k,s2)+1)+ones(1,k)'*[0:s1:(s1*s2)-1]; Output=In(ind); end;
Partager