Error while converting a HUGE symbolic equation to double (question edited and simplified further)

2 views (last 30 days)
[Question edited and simplified further]
Hi.
I perform huge computations worth 70 lines. After those 70 lines, i have these equations in my internal memory.
%(stored internally) Wnet=(99*((57443*((4018*y*(66875/(57036*x))^(2528214091580831/18014398509481984))/5 - (57443*y)/50 + (2894969*x^(200/623))/50))/(50*((57443*y)/50 - 41160000)) + 57443/50)*(y - y*(66875/(57036*x))^(2528214091580831/18014398509481984)))/100 + (99*(y - y*(66875/(57036*x))^(2528214091580831/18014398509481984))*((57443*((4018*y*(66875/(57036*x))^(2528214091580831/18014398509481984))/5 - (57443*y)/50 + (2894969*x^(200/623))/50))/(50*((57443*y)/50 - 41160000)) - (57443*((57443*y)/50 - (57443*y*(66875/(57036*x))^(2528214091580831/18014398509481984))/50))/(50*((57443*y)/50 - 41160000)) + 57443/50))/100 - (2894969*x^(200/623))/10 + 2894969/10;
%(stored internally) SFC=-(((57443.*y)./50 - (57443.*y.*(66875./(57036.*x)).^(2528214091580831./18014398509481984))./50)./((57443.*y)./50 - 41160000) - ((4018.*y.*(66875./(57036.*x)).^(2528214091580831./18014398509481984))./5 - (57443.*y)./50 + (2894969.*x.^(200./623))./50)./((57443.*y)./50 - 41160000))./((99.*((57443.*((4018.*y.*(66875./(57036.*x)).^(2528214091580831./18014398509481984))./5 - (57443.*y)./50 + (2894969.*x.^(200./623))./50))./(50.*((57443.*y)./50 - 41160000)) + 57443./50).*(y - y.*(66875./(57036.*x)).^(2528214091580831./18014398509481984)))./100 + (99.*(y - y.*(66875./(57036.*x)).^(2528214091580831./18014398509481984)).*((57443.*((4018.*y.*(66875./(57036.*x)).^(2528214091580831./18014398509481984))./5 - (57443.*y)./50 + (2894969.*x.^(200./623))./50))./(50.*((57443.*y)./50 - 41160000)) - (57443.*((57443.*y)./50 - (57443.*y.*(66875./(57036.*x)).^(2528214091580831./18014398509481984))./50))./(50.*((57443.*y)./50 - 41160000)) + 57443./50))./100 - (2894969.*x.^(200./623))./10 + 2894969./10);
How do i convert this huge symbolic equation to a 6x5 double array where x=5:5:30; y=1100:100:1500;
Help me please =)
If you are still confused with the question, let me know, i will try to clarify it more, or i will paste the entire script.

Accepted Answer

Alexander
Alexander on 13 Apr 2012
Does this work?
subs(subs(Wnet, x, 5:5:30)', y, 1100:100:1500)
respectively
subs(subs(SFC, x, 5:5:30)', y, 1100:100:1500)
  1 Comment
Vaibhav
Vaibhav on 13 Apr 2012
THANKS A LOT :D
it works.
Its actually gives solution to a MUCH bigger problem having 90 lines script.
I had been searching this since quite some time...
Once again thanks a lot =)

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 13 Apr 2012
[X, Y] = ndgrid(5:5:30, 1100:100:1500);
WnetF = matlabFunction(Wnet, x, y);
WnetN = double( arrayfun( WnetF, X, Y ) );

Products

Community Treasure Hunt

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

Start Hunting!