- 博客(23)
- 资源 (2)
- 收藏
- 关注
原创 Matlab 生成时间序列数据,存于TXT文本(version_2)
%%clear; clc; close all;global iiiiii = 0;period = 5; % 秒nvar = 50;frequency = 128;temp1 = now;stoptime = datenum(datestr(now+(1/24/3600)*period, 'yyyy-mm-dd HH:MM:SS.FFF'),'yyyy-mm-dd HH:MM:SS.FFF');fid=fopen('generate_highf.txt','w');fprintf(.
2021-12-25 17:11:33
947
原创 Matlab里面实时绘图
%% matlab 多图实时显示案例 clear;clc;close all; TF = figure; set(gcf, 'NumberTitle','off','Name', '三角函数') subplot(1,2,1); subplot(1,2,2); TFaxes = get(TF,'child'); Ball = figure; set(gcf, '...
2018-04-29 15:37:27
16677
原创 GSL学习之一:下载并编译GSL库
一、下载GSL库并biany点击打开GSL的下载链接:http://gnuwin32.sourceforge.net/packages/gsl.htm选择Sources那一行,点击进行下载将其解压在硬盘中的某个位置:在如图所示的路径下有三个Visual Studio的解决方案libgsl.sln就是用来编译GS
2017-09-16 10:21:57
4846
原创 如何在Qt中写自己的静态连接库
如何在Qt中写自己的静态连接库1 在Qt中写自己的静态链接库1.1 创建LIB库项目新建,选C++库选择静态链接库1.2 编写代码头文件:源文件:1.3 构建LIB项目2 编写静态链接库测试程序2.1 新建测试程序选择Qt控制台应用2.2 在工程文件下添加链接库的位置右键,添
2016-07-21 15:03:28
2111
原创 减少函数变量的方法
% %减少函数变量的方法;% %建立如下函数% % function y = parameterfun(x,a,b,c)% % y = a .* x .* x + b .* x + c;% % end% % % 减少参数% % 给定a, b, c% a = 1;% b = 1;% c = 1;% % 得到f(x)% f = @(x)parameter
2016-03-21 16:28:27
942
原创 matlab实现S域到Z域变换
传递函数如下: Z变换: 代码如下:%构造传递函数h = tf(10, [0.2 1 0])%Z变换zh = c2d(h, 0.2,'zoh')%得到分子分母系数[num den] = tfdata(zh, 'v')%得到零极点[z, p, k] = tf2zpk(num, den)运行结果如下:h = 10 ----------- 0.2 s^2 + s
2015-05-13 19:55:10
22750
7
原创 matlab求全相应
求全相应%求全相应clearsyms s t FsA = [0 1; -2 -3];B = [2; 0];X0 = [0;1];%输入u = exp(-t);%预解矩阵FsFs = inv(s*eye(2)-A);%预解矩阵拉普拉斯反变换得到矩阵指数函数eAt = ilaplace(Fs,s,t);%计算零输入响应X0u = eAt * X0;%求零状态syms tao F
2015-05-03 22:51:19
3663
原创 特征矩阵的矩阵指数
%特征值法syms tA = [0 1; -2 -3];[P D] = eig(A);Q = inv(P);expD = exp(D * t) .* (eye(2));eAt = simple(P * expD * Q)%预解矩阵Fssyms sFs = inv(s*eye(2)-A);%预解矩阵拉普拉斯反变换得到矩阵指数函数eAt = ilaplace(Fs,s,t);%化简
2015-05-03 21:42:00
1721
原创 状态空间描述到传递函数
2.14计算下列状态空间描述的传递函数G(s)clear;syms s;A = [0 1 0; 0 0 1; -3 -1 -2];B = [1 0; 0 1; 1 1];C = [1 1 1];D = [0 0];%第一个输出[num,den] = ss2tf(A, B, C, D, 1)%第二个输出[num,den] = ss2tf(A, B, C, D, 2)%预解矩阵FsF
2015-05-02 18:30:09
4081
原创 Matlab与Excel
从Excel中读入数据 在 j:\test.xlsx文件中准备数据 在Command Window中输入命令 N1 = xlsread(‘j:\test.xlsx’,’sheet1’,’A1:F251’) 即可读入数据 写入Execl文件 在往Excel文件中写入数据前要关闭要写入的Excel文件 关闭文件后才能写入数据
2015-05-02 13:30:36
730
原创 Matlab与Word交互
notebook的安装 在Matlab Command Window中输入notebook出现如下对话框 点击yes即可完成安装 2.notebook的使用 在Matlab中输入notebook即可新建一个Word文档,在Word中输入公式后,选中右键Evaluate Cells即可运算
2015-05-02 12:38:12
1254
原创 步进电机正反转
main.c#include<reg51.h>#include<function.h>#include<keyscan.h>#define speed 1sbit PH1 = P1^0; //定义管脚sbit PH2 = P1^1;sbit I01 = P1^2;sbit I11 = P1^3;sbit I02 = P1^4;sbit I12 = P1^5;void del
2015-05-02 10:49:46
1982
原创 74hc165串口转并口输入
74hc165.h#ifndef _74H165_H_#define _74H165_H_#include<reg51.h>#include<intrins.h>#define GPIO_LED P0sbit IN_PL = P1^6;sbit IN_Data = P1^7;sbit SCK = P3^6;#ifndef uchar #define uchar unsigned c
2015-05-02 10:36:26
2801
原创 74hc595串口转并口输出
74hc595.h#ifndef _74HC585_H_#define _74HC585_H_#include<reg51.h>#include<intrins.h>#include<function.h>#ifndef uchar #define uchar unsigned char#endif#ifndef uint #define uint unsigned int#end
2015-05-02 10:31:37
2047
原创 独立键盘
seperatedKey.h#ifndef _SEPERATEDKEY_H_#define _SEPERATEDKEY_H_#include<reg51.h>#ifndef uchar#define uchar unsigned char#endif#ifndef uint #define uint unsigned int#endif#define SEPERATEDKEYPORT P
2015-05-02 10:26:35
481
原创 串口通信
serial.h#ifndef _SERIAL_H_#define _SERIAL_H_#include<reg51.h>#ifndef uchar#define uchar unsigned char#endif#ifndef uint #define uint unsigned int#endifextern uint ints;extern uchar message[20];
2015-05-02 10:22:16
382
原创 PCF8591
pcf8591.h#ifndef _PCF8591_H_#define _PCF8591_H_#include<reg51.h>#include<i2c.h>#ifndef uchar#define uchar unsigned char#endif#ifndef uint #define uint unsigned int#endif//参考电压#define VREF 5.0/*
2015-05-02 10:19:38
1155
原创 I2C协议
i2c.h#ifndef _I2C_H_#define _I2C_H_#include<reg51.h>#ifndef uchar #define uchar unsigned char#endif#ifndef uint #define uint unsigned int#endifsbit I2C_SCL = P2^1;sbit I2C_SDA = P2^0;void I2C_
2015-05-02 10:06:04
408
原创 LCD1602
lcd1602.h#ifndef _LCD1602_H_#define _LCD1602_H_#include<reg51.h>/********************************************* 定义以下宏是为了便于4位数据传输和8位数据 传输的切换取消以下宏定义编译出来的是8位传输 *****************************************
2015-05-02 10:01:07
766
原创 七段数码管显示
seg7.h#ifndef _SEG7_H_#define _SEG7_H_#include<reg51.h>#ifndef uchar #define uchar unsigned char#endif#ifndef uint #define uint unsigned int#endif#define SEG7_PORT P0sbit SEGA = P2^2;sbit SEGB
2015-05-02 09:50:47
1665
原创 矩阵键盘扫描程序
51单片机矩阵键盘扫描程序 keyscan.h#ifndef _KEYSCAN_H_#define _KEYSCAN_H_#include<reg51.h>#ifndef uchar#define uchar unsigned char#endif#ifndef uint #define uint unsigned int#endif#define KEYPINS P1//定义矩阵键盘
2015-05-02 09:39:02
1282
Study_WindShearModel.slx
2020-02-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人