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?

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

Asked by sibananda mohanty

sibananda mohanty

on 22 Nov 2012
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

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.

Muruganandham Subramanian

Muruganandham Subramanian

on 22 Nov 2012

value for w?

sibananda mohanty

sibananda mohanty

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson

Walter Roberson

on 22 Nov 2012

After fixing the var() issue, replace

Q=@(w) G;

with

Q = matlabFunction(G);

0 Comments

Walter Roberson

Walter Roberson

Contact us