필터 지우기
필터 지우기

save for loop resutls

조회 수: 2 (최근 30일)
heir ancestors
heir ancestors 2017년 6월 19일
댓글: heir ancestors 2017년 6월 21일
hello everybody ,
I have a small code , I want to save the values of ab so in newwidt so that I can call them later newwidt(1) ,newwidt(2) ....etc
Sn is a 7*9 matrix , the results are not saving, I know it false as I wrote (saving part).
[a,b]=size(Sn);
newwidt=zeros(size(Sn));
for i=1:b
ab=repmat(Sn(:,i),1,b)
newwidt=ab(:,:)
end
thanks

채택된 답변

aborghes
aborghes 2017년 6월 19일
does changing newwidt=ab(:,:) to newwidt(:)=ab(:,:) do what you are looking for? This saves each value in an array of doubles.
  댓글 수: 3
aborghes
aborghes 2017년 6월 19일
sorry about that, i miss-typed. try newwidt(:,:,i). that saves each result in a new array that are all accessible.
heir ancestors
heir ancestors 2017년 6월 21일
Amazing !! it's woking, thank you very much :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by