Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Code Slows Down if I Preallocate Larger Variables?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, I am using Matlab to explicitly integrate equations of motion for a finite element mesh. In the code I initialise all the history variables (such as displacement, velocity and acceleration) to store all the values at every node for every time step.
displace = zeros(gdl,n_inc+1); %
epsilon = zeros(gdl,n_inc+1); %
stress = zeros(gdl,n_inc+1); %
The point is: if I use a larger number of time steps (i.e. a smaller time increment), every single step takes much more to run. Is that avoidable somehow?
7 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!