Error using * Inner matrix dimensions must agree.

조회 수: 1 (최근 30일)
Valeria Garcia
Valeria Garcia 2014년 10월 2일
댓글: Star Strider 2014년 10월 2일
Okay so I' trying put in the following commands.
%Constants%
hbar = 1.055e-34; %J s
c = 2.998e8; %m/s Speed of light
eps = 8.854e-12; %C^2/N/m^2 permitivity of free space
%system parameters%
W = 20e-6; %m Beam width
l = 300e-6; %m Beam length
h = 2e-6; %m Beam thickness
rho = 2.33e3; %kg/m^3 Material density (silicon)
E = 169e9; %Pa Youngs modulous
g = 8e-6; %m Initial gap distance
Q = 350 %Quality factor
V = 16; %V AC peak voltage
A = W*h; %m^2 Cross sectional area
I = W*h*h*h/12; %m^4 Cross sectional intertia
wn = 3.51562; %s^-1 natural frequency
%%%Constants from modeshapes%%%
g011 = 0.7830; % g011 = <1,phi_1>
g111 = 1; % g111 = <phi_1,phi_1>
g211 = 1.4778; % g211 = <phi_1^2, phi_1>
g311 = 2.3488; % g311 = <phi_1^3, phi_1>
%This constant tracks effects of Casimer Effect
%alpha = (pi*pi*hbar*c*W*l^4)/(240*g^5*E*I);
alpha = 0;
%This constant tracks effects of the Electrostatic Force
%delta =(eps*W*l^4)/(2*g^3*E*I)*V*V;
delta = .01;
%This constant tracks effects of Fringing Correction to Elec. Force
%f = 0.65*g/W;
f = 0.26;
%Dimensionless damping coeff.
%b0*l^2/g*sqrt(1/(rho*A*E*I));
%b = wn/Q
b = 0.001;
C1 = delta*(1+f)/2;
C2 = delta*(2+f)/2;
C3 = delta*(3+f)/2;
C4 = delta*(4+f)/2;
gamma=0.001:0.0001:pi;
amp = 2.*g111.*wn.*b./C3./g211./sin(gamma)-sqrt((2.*g111.*wn.*b./C3./g211./sin(gamma)).^2 - 4.*C1.*g011./C3./g211);
Where exactly should I put the periods so I don't get that error.
  댓글 수: 2
Nalini Vishnoi
Nalini Vishnoi 2014년 10월 2일
편집: Nalini Vishnoi 2014년 10월 2일
Please specify what are the values for b, alpha, delta, wn, g111 .
Valeria Garcia
Valeria Garcia 2014년 10월 2일
oops! should have explained more. I already put them.

댓글을 달려면 로그인하십시오.

답변 (1개)

Star Strider
Star Strider 2014년 10월 2일
We know gamma is a vector, but nothing about whether the other variables are vectors or scalars. In the absence of that information, just vectorise the entire expression unless you know specific operations involve only scalars.
Also, highlighting your code and then using the [{}Code] button makes it easier to read.
  댓글 수: 2
Valeria Garcia
Valeria Garcia 2014년 10월 2일
okay, done.
Star Strider
Star Strider 2014년 10월 2일
Did the complete vectorisation work, or are you still having problems?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Propagation and Channel Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by