View Single Post
  #13   Spotlight this post!  
Unread 06-12-2014, 19:13
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 1,580
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: OPR Programming Challenge

Quote:
Originally Posted by Ether View Post
Here's another optimization you can try. Replace this code:

X = A\B(:,1);
Y = A\B(:,2);

... with this:

XY = A\B

... then you'll have only one left-divide, and the XY vector will be a 2-column vector containing X and Y.


Made it a bit faster (0.02 seconds). I expected it to be a lot more, but surprisingly, reading the file into MATLAB is the longest operation at 0.31 seconds (That's reading in the file and creating my A and B matrices). It surprises me it takes that long with a the SSD I have.