how do i save looped output into 1 variable matrix
显示 更早的评论
c=19;
>> D=[];
>> for k=1:c;
Z=[X(:,1),Y(:,1)];
p=anova1(Z)
D=save(p)
X(:,1)=[];Y(:,1)=[];
end
4 个评论
James Kristoff
2013-5-9
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
2013-5-10
john borsellino
2013-5-10
john borsellino
2013-5-10
采纳的回答
更多回答(1 个)
bym
2013-5-9
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
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!