how do i save looped output into 1 variable matrix
Afficher commentaires plus anciens
c=19;
>> D=[];
>> for k=1:c;
Z=[X(:,1),Y(:,1)];
p=anova1(Z)
D=save(p)
X(:,1)=[];Y(:,1)=[];
end
4 commentaires
James Kristoff
le 9 Mai 2013
Can you please clarify you are asking for?
the code snippet you shared:
c=19;
D=[];
for k=1:c;
Z=[X(:,1),Y(:,1)];
p=anova1(Z)
D=save(p)
X(:,1)=[];Y(:,1)=[];
end
does not have a clear intent. There is a FOR loop, but you are not using the looping variable k anywhere in the loop.
Also, I am not sure what you mean by save, or 1 variable matrix.
john borsellino
le 10 Mai 2013
john borsellino
le 10 Mai 2013
john borsellino
le 10 Mai 2013
Réponse acceptée
Plus de réponses (1)
bym
le 9 Mai 2013
c=19;
% D=[];
p = zeros(c,1); % preallocate
for k=1:c;
Z=[X(:,1),Y(:,1)];
p(k)=anova1(Z);
%D=save(p) unecessary
%X(:,1)=[];Y(:,1)=[]; don't change X or Y!
end
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!