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: Speed up fairly short code
Replies: 9   Last Post: Jul 17, 2013 4:48 PM

Advanced Search

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

Posts: 18,038
Registered: 12/7/04
Re: Speed up fairly short code
Posted: Jul 17, 2013 9:46 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Eric Sampson" <> wrote in message
> "Steven_Lord" <> wrote in message
> <ks3jql$4jb$>...

>> "Kobye " <> wrote in message
>> news:ks1luv$i3h$

>> > I have a code (script) of 462 lines. In parts, it uses the symbolic
>> > toolbox. It also makes calls to 3 other functions that I have written,
>> > that are already highly efficient.
>> >
>> > The code is a mechanical model (theory of elasticity) that describes
>> > two plates joined by adhesive. The model is very elegant in its
>> > formulation, but currently it is way too slow. I have the option of
>> > either discarding it, or massively speeding it up. I have reason to
>> > believe that large speed increases are feasible (similar models exist
>> > and have been used for sensitivity analyses in the literature).
>> >
>> > If anyone would like to help me find ways to speed it up, your help
>> > would be immeasurably appreciated. I will send you the code privately
>> > as I don't necessarily want it in the public domain.
>> >
>> > Kobye
>> >
>> > PS the main bottlenecks seem to be symbolic integrations of my
>> > Bernstein basis polynomials. I think that maybe the code could be sped
>> > up here by using the Matlab poly options, but I am totally unfamiliar
>> > with these.

>> Try converting that symbolic integration into numeric integration using
>> matlabFunction, FEVAL, or EVALIN (as shown in the Tips section of the
>> documentation page below) and INTEGRAL.
>> --
>> Steve Lord

> Steve, do you think this type of situation could be detected by M-lint and
> highlighted in the Editor?

It might be detectable, but I don't think it should be reported. In some
cases, you actually want to perform the symbolic integration; in this case,
I think numeric integration would be sufficient for the OP's situation.

Steve Lord
To contact Technical Support use the Contact Us link on

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.