how do i save looped output into 1 variable matrix
Mostrar comentarios más antiguos
c=19;
>> D=[];
>> for k=1:c;
Z=[X(:,1),Y(:,1)];
p=anova1(Z)
D=save(p)
X(:,1)=[];Y(:,1)=[];
end
4 comentarios
James Kristoff
el 9 de Mayo de 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
el 10 de Mayo de 2013
john borsellino
el 10 de Mayo de 2013
john borsellino
el 10 de Mayo de 2013
Respuesta aceptada
Más respuestas (1)
bym
el 9 de Mayo de 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
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!