MATLAB Answers

Ahmed
0

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 ????

Ahmed
さんによって質問されました 2013 年 2 月 17 日
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 件のコメント

Please post your code, or a subset of it, that produces the problem. It is likely incorrect indexing, but we need to see your code to help you.
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.
I already know what's in the Mind Reading Toolbox:
function Read_Programmers_Mind(varargin)
disp('Ask Walter')
end
;-)

サインイン to comment.

2 件の回答

回答者: 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

  0 件のコメント

サインイン to comment.


回答者: manoj saini 2013 年 2 月 17 日

for k=1:210 v(1,:)=your calculation end
try it....it will save your all 210 values

  0 件のコメント

サインイン to comment.



Translated by