Info

This question is closed. Reopen it to edit or answer.

please find the answer of the programme it is showing some error,i've tried a lot to slove but could not ablie to,. please help

1 view (last 30 days)
clc
clear all
var w;
alpha=0.05
mu=0.05;
ztap=0;
ztaa=sqrt(3*mu/(8*(1+mu)));
omegaa=(1/(1+mu));
a1=1-alpha;
a2=2*ztaa*omegaa+2*ztap+2*ztaa*omegaa*mu;
a3=omegaa^2+4*ztap*ztaa*omegaa+mu*omegaa^2+1;
a4=2*ztap*omegaa^2+2*ztaa*omegaa;
a5=omegaa^2;
A=a1*omegaa^2*w^4-a3*omegaa^2*w^2+a5*omegaa^2-a1*w^6+a3*w^4-a5*w^2+2*ztaa*omegaa*a4*w^2-2*ztaa*omegaa*a2*w^2;
B=a4*w^3-a2*w^3-a4*omegaa^2*w+a2*omegaa^2*w+2*ztaa*omegaa*w^5-2*ztaa*omeggaa*a3*w^3+2*ztaa*omegaa*w*a5;
C=(a1*w^4-a3*w^2+a5)^2+(a4*w-a2*w)^2;
G=sqrt(A^2+B^2)/C^2;
Q=@(w) G;
S=quad(G,0,2);
  2 Comments
Walter Roberson
Walter Roberson on 22 Nov 2012
Edited: Walter Roberson on 22 Nov 2012
What error is it showing, at what line?
Are you sure that you want to calculate the variance of the string 'w' ? That is what
var w;
will do. It is equivalent to
var('w')
and var() is the variance function.

Answers (1)

Walter Roberson
Walter Roberson on 22 Nov 2012
After fixing the var() issue, replace
Q=@(w) G;
with
Q = matlabFunction(G);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!