代码搜索结果
找到约 36,166 项符合
Raspberry Pi 的代码
6_26.cpp
#include
using namespace std;
int main()
{ int i=10,j=20;
const int* pi=&i; //指向常量的指针
//*pi=20; //错误1:不能通过pi改变所指向变量的值
cout
6_46.cpp
#include
using namespace std;
int main()
{ int *pi;
//pi=3.5;//语句1:错误,没有内存单元被分配给*pi
int i=3;
pi=&i;//语句2:通过将变量的地址赋给指针变量进行初始化
cout
exp2_4_.m
close all
clc
clear
%定义时间范围
t=[0:pi/20:9*pi];
hold on %允许在同一坐标系下绘制不同的图形
plot(t,sin(t),'r:*')
plot(t,cos(t))
plot(t,-cos(t),'k')
grid on %在所画出的图形坐标中添加栅格,注意用在plot之后
hold off %覆盖旧图
exp2_3_.m
%plot绘图命令的使用
close all %关闭打开了的所有图形窗口
clc %清屏命令
clear %清除工作空间中所有变量
%定义时间范围
t=[0:pi/20:8*pi];
y=sin(t);
plot(t,y,'b:square')
% r表示线的颜色为红色,此外 y(黄色)g(绿色)b(蓝色)
%
exp2_4.m
close all
clc
clear
%定义时间范围
t=[0:pi/20:9*pi];
figure(1) %选择图像
plot(t,sin(t),'r:*')
grid on %在所画出的图形坐标中添加栅格,注意用在plot之后
grid off %删除栅格
figure(2)
plot(t,cos(t))
grid on
grid off
exp2_5_.m
%图形文字标示命令的使用
clear
close all
clc
t=[0:pi/20:5*pi];
plot(t,sin(t),'r:*')
axis([0 5*pi -1.5 1.5 ])
%给x轴和y轴命名
xlabel('t(deg)')
ylabel('magnitude')
%给图形加标题
title('sine wave from zero to 5\pi')
exp2_3.m
%plot绘图命令的使用
clc %清屏命令
clear %清除工作空间中所有变量
%定义时间范围
t=[0:pi/20:9*pi];
y1=sin(t);
y2=cos(t);
plot(t,y1,t,y2)
ip_02_08.m
% MATLAB script for Illustrative Problem 2.8.
delta_w=2*pi/100;
w=-pi:delta_w:pi; % one period of Sy
Sy=1./(1.9025-1.9*cos(w));
% Plotting command follows.
plot(w,Sy);
il3_8fun.m
% il3_8fun.m
function f=il3_8fun(x,p)
f=1/sqrt(2*pi)*exp((-(x-p).^2)/2).*log2(2./(1+exp(-2*x.*p)));
chapter3_1.m
clear all
a=sym(sin(2) ) %创建符号常量,注意和 >>a=sin(2)的区别
a1=2*sqrt(5)+pi %创建数值常量
a2=sym('2*sqrt(5)+pi') %创建符号常量
a3=sym(2*sqrt(5)+pi) %按最接近的有理数型表示符号常量
a4=sym(2*sqrt