필터 지우기
필터 지우기

Data must be numeric, datetime, duration or an array convertible to double.

조회 수: 2 (최근 30일)
I wrote a following code. It shows error:"Data must be numeric, datetime, duration or an array convertible to double."
clear all
clc
syms x
h=4;
q=0;
delta=26;
phi=39;
kh=0;
kv=0;
psi=atan(kh/(1-kv));
da1=delta*(pi/180); pha1=phi*(pi/180);
m=pha1+da1;
b=pha1-psi;
c=psi+da1;
gma=18.4; nq=2*q/(gma*(x));
delta=26;
phi=39;
lam=0;
A=lam*nq/(1+nq);
alphac=atan((sin(m)*sin(b)+(sin(m)^2+sin(b)^2+sin(m)*cos(m)*sin(b)*cos(b)+A*cos(c)*cos(m)*sin(b))^0.5)/(A*cos(c)+sin(m)*cos(b)));
w=0.5*gma*(x)^2*(1/tan(alphac));
B=(x)*((1/tan(alphac))-lam);
ka1=((1+nq)*(1-A*tan(alphac))*(cos(b)-(sin(b)/tan(alphac))))/(cos(psi)*(cos(m)+tan(alphac)*sin(m)))
pa1=0.5*gma*x^2*ka1
x=0:0.1:5;
plot(pa1,x)

채택된 답변

madhan ravi
madhan ravi 2019년 3월 15일
syms x
h=4;
q=0;
delta=26;
phi=39;
kh = 0;
kv=0;
s=...; % didn't define s
psi = atan (kh / (1-kv));
da1 = delta * (pi / 180); pha1 = phi * (pi / 180);
m=pha1+da1;
b=pha1-psi;
c=psi+da1;
gma = 18.4;
nq = 2 * q / (gma * (x));
delta=26;
phi=39;
lam = 0;
leg=...; % didn't define leg
Null=...;
A = lam * s / (1 + Null);
% ^---only one
alphac = atan ((sin (m) * sin (b) +...
(sin (m) ^ 2 + sin (b) ^ 2 +...
sin (m) * cos (m) * sin (b) * cos (b) +...
A * cos (c) * cos (m) * sin (b) ^ 0.5) / (A * cos (c) +...
sin (m) * cos (b))));
w=0.5*gma*(x)^2*(1/tan(alphac));
B = (x) * ((1 / tan (alphac)) - lam);
ka1 = ((1 + nq) * (1-A * tan (alphac)) *...
(cos (b) - (sin (b) / tan (alphac))))...
* (cos (psi) * (leg*(m ) + tan (alphac) * sin (m)))
% ^---- missed it
pa1 = matlabFunction(0.5 * gma * x ^ 2 * ka1);
x=0:0.1:5;
plot(pa1(x),x)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by