Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Speed up
Replies: 1   Last Post: Mar 8, 2014 2:20 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ghulaam

Posts: 1
Registered: 3/8/14
Speed up
Posted: Mar 8, 2014 11:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi would appreciate some assistance in speeding up the following code via vectorisation

for h = 0.9:0.05:1.8
for iv = 0.2:0.1:2
y(1)=iv;
for k = 2:520
y(k) = y(k-1)+h*(y(k-1)+0.5*h*y(k-1)*(1-y(k-1)))*(1-y(k-1)-0.5*h*y(k-1)*(1-y(k-1)));
end
plot(h*(ones(20,1)), y(501:520),'*'), set(gca(),"auto_clear","off")
end
end

title('Modified Euler')
xlabel('h'), ylabel('last 20 y')

set(gca(),"grid",[1 1]), set(gca(),"auto_clear","on")


Date Subject Author
3/8/14
Read Speed up
Ghulaam
3/8/14
Read Re: Speed up
Curious

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.