- #1
PlasticOh-No
- 18
- 0
MATLAB "quad" and difficulty with vector input
Hello all.
Consider the following:
function y = testf(x,a)
y = sin(pi.*a.*x);
...and then we have
a = 0.05:0.05:1;
result1 = quad(@(x)testf(x, a),0,1)
which crashes with
? Error using ==> times
Matrix dimensions must agree.
Can you help?
Thank you.
Hello all.
Consider the following:
function y = testf(x,a)
y = sin(pi.*a.*x);
...and then we have
a = 0.05:0.05:1;
result1 = quad(@(x)testf(x, a),0,1)
which crashes with
? Error using ==> times
Matrix dimensions must agree.
Can you help?
Thank you.