필터 지우기
필터 지우기

How do we store the results of a loop vertically?

조회 수: 5 (최근 30일)
Wolfgang McCormack
Wolfgang McCormack 2021년 3월 10일
댓글: Adam Danz 2021년 3월 10일
Hi everyone,
Is this a correct way to store the values of a loop vertically in an excel file?
CompiledResults(:,i) = Output
also, what is the difference between this and store option?

채택된 답변

Adam Danz
Adam Danz 2021년 3월 10일
편집: Adam Danz 2021년 3월 10일
> Is this a correct way to store the values of a loop vertically in an excel file?
CompiledResults(:,i) = Output
Well, no. That appears to store values vertically within a variable named CompiledResults, in column i. Check out this page from the documentation on how to write to excel files.
> what is the difference between this and store option
I'm not sure what this means. Are you refering to datastore methods (I doubt it)?
Perhaps adding some more context would help, if this doesn't address your question.
  댓글 수: 2
Wolfgang McCormack
Wolfgang McCormack 2021년 3월 10일
@Adam Danz Thanks Adam, I guess I wrote the post a bit in a hurry. So, I want the loop runs and store my values vertically for each run in a column. Then, I want to write that to an excel. So, I guess this will do the job of storing data in one clean variable with 100 columns/loops.
Adam Danz
Adam Danz 2021년 3월 10일
Does the loop produce a scalar value (size 1x1) or a vector? The line that you have stores a vector but can easily store a scalar in row j using,
CompiledResults(j,i) = ___

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

추가 답변 (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