The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: 2d vectorization challenge
Replies: 10   Last Post: Apr 19, 2009 4:27 PM

Advanced Search

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

Posts: 49
Registered: 4/1/08
2d vectorization challenge
Posted: Apr 19, 2009 9:28 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Can anyone speed up this snippet?
('sin' stands in for an arbitrary function)

Thank you.

n = 1e3;
x = 1:n;
P = nan(n);
for i = 1:n
for j = 1:n
P(i,j) = sin(x(i)*x(j));

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.