矢量传感器 源代码
《矢量传感器》是2006年哈尔滨工程大学出版社出版的图书,作者是陈洪娟。
function y=D(A,B)%计算两矢量间的距离 var1=length(A); var2=0; for i=1:var1 var2=var2+(A(i)-B(i))^2; end y=sqrt(var2);
close all clear all p=[0.2,0.2,0.2,0.2,0.2]; h=entropy(p);%返回该概密矢量的比特熵h [code,l]=huffman(p);%返回Huffman矩阵、平均码字长度l h code l
function y=pathlong(l,tspdist)%l为路径矢量,tspdist为距离矩阵% x1=size(l); x2=x1(1,2); y=0; for j=1:(x2-1) y=y+A(l(j),l(j+1)); end …
function y=pathlong(l,tspdist)%l为路径矢量,tspdist为距离矩阵% x1=size(l); x2=x1(1,2); y=0; for j=1:(x2-1) y=y+tspdist(l(j),l(j+1));…
function y=D(A,B)%计算两矢量间的距离 var1=length(A); var2=0; for i=1:var1 var2=var2+(A(i)-B(i))^2; end y=sqrt(var2);
#include //#include "defs_c51_manio.h" #include "INTRINS.H" #define uchar unsigned char #define uint unsigned int unsigned…
////////////////////////////接触传感器程序/////////////////////////// void touch(void) interrupt 0 //接触传感器函数,当接触到…