matlabFunction never finish converting

1 view (last 30 days)
hau sze
hau sze on 18 Aug 2014
Commented: Star Strider on 18 Aug 2014
I'm trying to convert a quite long symbolic expression to a file, but the "matlabFunction" function never finish converting. I attached the .mat for your reference.
Is there any alternative of doing that? Or should I use something else to build this symbolic function in the first place?

Answers (1)

Star Strider
Star Strider on 18 Aug 2014
Nothing was attached.
Before you call matlabFunction, always call collect and simplify first with your expression, and in that order. The Symbolic Math Toolbox will not do that itself as part of a matlabFunction conversion. That may be the problem.
  2 Comments
hau sze
hau sze on 18 Aug 2014
Sorry about that, the file is attached now. (I didn't click "attach file" earlier.)
Star Strider
Star Strider on 18 Aug 2014
Please don’t post that as a .mat file. I don’t know what’s in that file, but it kept loading (or doing something) for about five minutes and I couldn’t interrupt it. I finally had to exit MATLAB to get it to stop. Save it as a .m file instead, so I can look at your code and see what the problem may be.
I’ll check back later.

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!