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: Need to make VPA based function faster
Replies: 1   Last Post: Mar 24, 2013 11:33 PM

Advanced Search

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

Posts: 12
Registered: 3/28/12
Need to make VPA based function faster
Posted: Mar 23, 2013 6:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello everyone,

I have the following function in which I use the VPA command to get more precision;
the problem i get is that this command is very time consuming, I need to call is hundreds of thousands of times.

Could anyone please tell how to make it faster? Are there any alternative faster solutions?

My Matlab code:

function [out]=schaff(indiv)

x=indiv.^2;

num=sin(vpa(sqrt(sum(x))))^2-0.5;

den=(1+0.001*(sum(x)))^2;
out=double(0.5 +num./den);


PS: even sym command is very time consuming.

Thank you in advance



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.