Subject: Error using Quad From: Jimmy Varghese Date: 21 Jul, 2012 17:32:16 Message: 1 of 3 Hi All, I am seeing the following error using quad. quad(@myfun2, 0,0.3,[],1) ??? Input argument 'iii' is undefined. Here is my function function phi = myfun2(x,iii) n = 6; L=0.3; cal=5; ii=1; while ii< n+1     mu(ii)=cal*pi/4;     cal=cal+4;       ii=ii+1; end for i = 1:n     N(i) = sqrt(L)*(sqrt(abs(cos(mu(i))*cosh(mu(i))-1)*abs(2*sin(mu(i))*sinh(mu(i)))))/abs(cos(mu(i))-cosh(mu(i))); end phi = (1./N(iii))*((sin(mu(iii))-sinh(mu(iii)))./(cos(mu(iii))-cosh(mu(iii)))*(cos(mu(iii)*x/L)-cosh(mu(iii)*x/L))-(sin(mu(iii)*x/L)-sinh(mu(iii)*x/L)));
 Subject: Error using Quad From: Torsten Date: 23 Jul, 2012 06:33:43 Message: 2 of 3 On 21 Jul., 19:32, "Jimmy Varghese" wrote: > Hi All, > > I am seeing the following error using quad. > quad(@myfun2, 0,0.3,[],1) > ??? Input argument 'iii' is undefined. > > Here is my function > > function phi = myfun2(x,iii) > > n = 6; > L=0.3; > cal=5; > ii=1; > while ii< n+1 > mu(ii)=cal*pi/4; > cal=cal+4; > ii=ii+1; > end > > for i = 1:n > N(i) = sqrt(L)*(sqrt(abs(cos(mu(i))*cosh(mu(i))-1)*abs(2*sin(mu(i))*sinh(mu(i)))))/abs(cos(mu(i))-cosh(mu(i))); > end > > phi = (1./N(iii))*((sin(mu(iii))-sinh(mu(iii)))./(cos(mu(iii))-cosh(mu(iii)))*(cos(mu(iii)*x/L)-cosh(mu(iii)*x/L))-(sin(mu(iii)*x/L)-sinh(mu(iii)*x/L))); iii=1; a=0; b=0.3; q=quad(@(x)myfun2(x,iii),a,b); function phi = myfun2(x,iii) ... Best wishes Torsten.

### Everyone's Tags:

Separated by commas
Ex.: root locus, bode

### 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.