代码搜索结果
找到约 10,000 项符合
Raspberry Pi 的代码
chap9_7i.m
%Flight Simulator Servo System
clear all;
close all;
J=2;
b=0.5;
kv=2;
kp=15;
kd=6;
f1=(b+kd*kv);
f2=J;
F=1;
A=1;
t=[0:0.001:10]'; %Simulation time
r=A*sin(2*pi*F*t);
dr=2*pi
chap10_5plant.m
%S-function for continuous state equation
function [sys,x0,str,ts]=s_function(t,x,u,flag)
switch flag,
%Initialization
case 0,
[sys,x0,str,ts]=mdlInitializeSizes;
case 1,
sys=mdlDer
chap10_6s.m
function [sys,x0,str,ts] = spacemodel(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts]=mdlInitializeSizes;
case 1,
sys=mdlDerivatives(t,x,u);
case 3,
sys=mdlOutputs(t,x,u);
case
chap10_1s.m
function [sys,x0,str,ts] = spacemodel(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts]=mdlInitializeSizes;
case 3,
sys=mdlOutputs(t,x,u);
case {2,4,9}
sys=[];
otherwise
erro
chap10_5s.m
function [sys,x0,str,ts] = spacemodel(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts]=mdlInitializeSizes;
case 3,
sys=mdlOutputs(t,x,u);
case {2,4,9}
sys=[];
otherwise
erro
chap3_10plot.m
clear all;
close all;
L1=-pi/6;
L2=pi/6;
L=L2-L1;
T=L*1/1000;
x=L1:T:L2;
figure(1);
for i=1:1:3
gs=-[(x+pi/6-(i-1)*pi/6)/(pi/12)].^2;
u=exp(gs);
hold on;
plot(x,u);
end
xlab
数据类型自动转换,强制转换.cpp
#include /**/
void main()
{
float PI=3.14159f;
int s,r=5,t;
s=r*r*PI;
printf("\n\n 圆面积为%d\n\n",s);
t=85;
printf(" s=%f\n",(float)s);
printf(" t=%f\n",(double)t);
printf
循环求圆面积,圆周长.cpp
#include /*求圆面积,圆周长*/
#define PI 3.14
void main()
{
printf("\n");
float r1=1.5,r2; double s1,s2,c1,c2;
s1=PI*r1*r1;
c1=2*PI*r1;
printf("\n 当给出圆半径为1.5时,求得圆面积为%.4f,圆周长为%.4f\n\n",s
e_141_02.f90
real*8 a, pai, pi_
a=1.d-307; print *, a, 1./a; print *, tiny(a), huge(a)
b=1.e-39 ; print *, b, 1./b; print *, tiny(b), huge(b)
pi =3.14159265358979_8 ; print *, pi ! pi 无双精度定义,仍为单精度。
a =3.
e_121_02.f90
! ------求圆錐体积和表面积------
PROGRAM Example_1_2
REAL :: pi, r, h, v, s
pi = 3.141593
PRINT *,'Input radius r and height h ?'
READ *, r, h
v = pi*h*r**2/3.0
s = pi*r*(r + sqrt(r**2 + h**2))