|
You are both right, compute expm(B) outside the loop first. However, I need all the values of V. -a<= x1,x2,x3,x4 <=a, where a can be any integer.
"Steven_Lord" <slord@mathworks.com> wrote in message <i2crpp$jcj$1@fred.mathworks.com>...
>
>
> "Stefan " <aidematlab@yahoo.ca> wrote in message
> news:i2cr4t$7oq$1@fred.mathworks.com...
> > thx for these remarks.
> > But i don't see how to do what you suggested. I also have
> > [x1;x2]'*expm(B)*[x3;x4] to compute.
>
> Does expm(B) depend on any of x1, x2, x3, or x4? If not, why compute it
> inside those loops?
>
> You're computing that quantity 201^4 times -- you only need to calculate it
> once, and then you can USE it as often as you need to use it. That's what
> Walter was alluding to.
>
> Anyway, related to Roger's question later in the thread -- do you actually
> need all 201^4 values of V or is the code correct and you only need the
> value of V corresponding to the situation where all of x1, x2, x3, and x4
> are equal to 10? If the latter, only calculate that one value of V and your
> computation will be complete MUCH, MUCH more quickly.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
|