Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
numerical integration parmeterized with vectors

Subject: numerical integration parmeterized with vectors

From: tombalabomba

Date: 30 Jul, 2014 08:37:17

Message: 1 of 1

Hi folks!

I have problems to integrate a scalar function wich is parametrized by 2 Nx1 vectors.

fun = @(b,x,y) (y-exp(-b*x)).'*(y-exp(-b*x));
M = integral(@(b)fun(b,t,z), 0,1);

whereas t and z are previous calculated Nx1 parameter vectors.

Unfortunatly, I get following error message

Error using *
Inner matrix dimensions must agree.
Error in @(b,x,y)(y-exp(-b*x)).'*(y-exp(-b*x))

Error in @(b)fun(b,t,z)

Error in integralCalc/iterateScalarValued (line 314)
                fx = FUN(t);
Error in integralCalc/vadapt (line 133)
            [q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 76)
        [q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 89)
Q = integralCalc(fun,a,b,opstruct);

I can't understand the dimension problem since the integrant is scalar function of b.

An help will be appreciated!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us