Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to solve very complex equations in matlab?
Replies: 13   Last Post: Jul 6, 2013 7:20 AM

 Messages: [ Previous | Next ]
 Torsten Hennig Posts: 2,419 Registered: 12/6/04
Re: How to solve very complex equations in matlab?
Posted: Jul 4, 2013 5:34 AM

> f1,f2,f3,f4 are functions. So, I don't think we can
> add them to a value(sum is initialized to 0).
> these three commands are not working.
> sum1=sum1+f1*f2;
> sum2=sum2+f1*f3;
> sum3=sum3+f1*f4
> I tried it. Please check it once. May be we have to
> initialize in a different way. I have written the
> four functions separately in .m files and called
> them. Once check it if you can.
> Thanks,
> srinath

In my notation, your functions are func_1, func_2, funk_3 and func_4 - f1,f2,f3 and f4 are the values the functions produce for the input arguments x,y,z,a(j) and b(j).
You can define the functions before the for-loop by setting e.g.
func_1 = @(x,y,z,a,b) x+y+z+2*a+4*b;
If your functions are more complicated, you will have to put them in separate m-files which will look like

result1 = func_1(x,y,z,a,b)
result1=x+y+z+2*a+4*b;

Best wishes
Torsten.

Date Subject Author
7/4/13 Srinath
7/4/13 Torsten Hennig
7/4/13 Srinath
7/4/13 Torsten Hennig
7/4/13 Srinath
7/4/13 Torsten Hennig
7/4/13 Srinath
7/5/13 Torsten Hennig
7/5/13 Srinath
7/5/13 Torsten Hennig
7/5/13 Srinath
7/5/13 Torsten Hennig
7/5/13 Srinath
7/6/13 Torsten Hennig