Hi, I have a loop which calculate 110 values of velocity, i want to assign all these values in one array. Every time i try only the last value is assigned. Any help ????

조회 수: 1 (최근 30일)
Hi, I have a loop which calculate 110 values of velocity, i want to assign all these values in one array. Every time i try only the last value is assigned. Any help ????
  댓글 수: 3
Image Analyst
Image Analyst 2013년 2월 17일
I can't imagine the code either. I'm still waiting for the Mathworks to give me the beta version of their Mind Reading Toolbox. It's been a frustratingly long wait, especially when we see so many situations, just like this one, where we could put it to immediate use.
Walter Roberson
Walter Roberson 2013년 2월 17일
I already know what's in the Mind Reading Toolbox:
function Read_Programmers_Mind(varargin)
disp('Ask Walter')
end
;-)

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

답변 (2개)

Walter Roberson
Walter Roberson 2013년 2월 17일
You probably have something like
for i = 1 : 110
velocity = ... some function involving i ...
end
Instead you need to use
for i = 1 : 110
velocity(i) = ... some function involving i ...
end

manoj saini
manoj saini 2013년 2월 17일
for k=1:210 v(1,:)=your calculation end
try it....it will save your all 210 values

카테고리

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