关于hogmatlab源代码的信息
admin 发布:2022-12-19 19:11 128
今天给各位分享hogmatlab源代码的知识,其中也会对进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
如何查看matlab函数源代码
1、在命令窗口中输入:type 函数名(例如type rgb2gray等),就会在命令窗口出现该函数的相关说明及源代码;
2、在命令窗口中输入:open 函数名(例如open rgb2gray等),就会打开该函数的m文件;
3、在命令窗口中输入:edit函数名(例如edit rgb2gray等),同样会打开该函数的m文件;
4、还有一种方法就是故意将原函数的参数类型或者个数写错,就会出现出错提示,点击提示出错处,也可以打开该函数的m文件;
很多大型的函数都能获得源代码,但是MATLAB里面有一些built-in函数是看不到源代码的,sort就是其中之一。这些函数是预编译好的,运行效率非常好,比如像find、min、max等频繁用到的一些函数还有很多矩阵运算函数都是built-in函数。
自带函数,用type+函数名。比如,type dwt2可以显示dwt2函数的代码
但是,好像没有qpsk这个函数.
matlab源代码
hrollfcoef这个函数不是matlab自带的
function [xh] = hrollfcoef(irfn,ipoint,sr,alfs,ncc)
%****************** variables *************************
% irfn : Number of symbols to use filtering
% ipoint : Number of samples in one symbol
% sr : symbol rate
% alfs : rolloff coeficiense
% ncc : 1 -- transmitting filter 0 -- receiving filter
% *****************************************************
xi=zeros(1,irfn*ipoint+1);
xq=zeros(1,irfn*ipoint+1);
point = ipoint;
tr = sr ;
tstp = 1.0 ./ tr ./ ipoint;
n = ipoint .* irfn;
mid = ( n ./ 2 ) + 1;
sub1 = 4.0 .* alfs .* tr; % 4*alpha*R_s
for i = 1 : n
icon = i - mid;
ym = icon;
if icon == 0.0
xt = (1.0-alfs+4.0.*alfs./pi).* tr; % h(0)
else
sub2 =16.0.*alfs.*alfs.*ym.*ym./ipoint./ipoint;
if sub2 ~= 1.0
x1=sin(pi*(1.0-alfs)/ipoint*ym)./pi./(1.0-sub2)./ym./tstp;
x2=cos(pi*(1.0+alfs)/ipoint*ym)./pi.*sub1./(1.0-sub2);
xt = x1 + x2; % h(t) plot((1:length(xh)),xh)
else % (4alphaRst)^2 = 1plot((1:length(xh)),xh)
xt = alfs.*tr.*((1.0-2.0/pi).*cos(pi/4.0/alfs)+(1.0+2.0./pi).*sin(pi/4.0/alfs))./sqrt(2.0);
end % if sub2 ~= 1.0
end % if icon == 0.0
if ncc == 0 % in the case of receiver
xh( i ) = xt ./ ipoint ./ tr; % normalization
elseif ncc == 1 % in the case of transmitter
xh( i ) = xt ./ tr; % normalization
else
error('ncc error');
end % if ncc == 0
end % for i = 1 : n
%******************** end of file ***************************
网上找的,你看看能不能拼到你那个程序里去
matlab 源代码
clear all;
m=1; %转子质量
r=57e-3;%轴颈半径
c=0.2e-3;%轴承半径间隙
yt=18e-3 ;%润滑油黏度
L=28.5e-3;%轴瓦宽度
% kp=1.052e8;c1=4000;c2=9000;
w=1000;%转速
e=0.06e-3;%质量偏心
g=9.8;%重力加速度
D=2*r;%轴颈直径
fai=c/r;%间隙比
pi=3.14159265;
%%%%%%%%%%%%%%无量纲化
G=g/(c*w^2);%无量纲g
P=e/c;%无量纲质量偏心率
MM=(m*c*w*fai^2)/(yt*L*r);%无量纲质量
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%x=zeros(2,1);
%x1=zeros(2,1);
%x2=zeros(2,1);
%x0=[0.8,0.8,0.8,0.8]';
%dt=pi/100;
u=[-0.8638,0.2512]';%位移初始值
v=[-0.2039,-0.7229]';%速度初始值
a=[0,0]';%加速度初始值
%t(1)=0; %时间
x(:,1)=u; %位移
x1(:,1)=v; %速度
x2(:,1)=a; %加速度
%M=zeros(2);
%K=zeros(2);
%C=zeros(2);
%Q=zeros(2,1);
%F=zeros(2,1);
M=[MM,0;
0,MM];
%newmark参数设置
gamma=0.5;
dt=pi/100;
delta=0.25;
a0=1/(delta*dt^2);
a1=gama/(delta*dt);
a2=1/(delta*dt);
a3=1/(2*delta)-1;
a4=gamma/delta-1;
a5=dt*(gamma/(2*delta)-1);
a6=dt*(1-gamma);
a7=gamma*dt;
%等效刚度矩阵
Ke=K+a0*M+a1*C;
t_max=1*pi; %计算时间总长
i=1;
t(1)=0;
%q=zeros(2,1);
%fid1=fopen('weiyi.dat','wt');
while t(i)t_max
%%%%%%广义力设定
%Qx=w^2*ww*ee*cos(t(i));
%Qy=w^2*ww*ee*sin(t(i));%此时不考虑重力
tao=w*t(i);%无量纲时间
Qx=MM*P*sin(tao);
Qy=MM*P*cos(tao)+MM*G;
Q=[Qx,Qy]';
%Q(i)=[MM*P*sin(tao(i)),MM*P*cos(tao(i))+MM*G]';
arf=atan((x1(1,i)+2*x(2,i))/(x(1,i)-2*x1(2,i)))-pi/2*sign((x1(1,i)+2*x(2,i))/(x(1,i)-2*x1(2,i)))-pi/2*sign(x1(1,i)+2*x(2,i));
Ga=2/sqrt(1-x(1,i)^2-x1(1,i)^2)*(pi/2+atan((x1(1,i)*cos(arf)-x(1,i)*sin(arf))/sqrt(1-x(1,i)^2-x1(1,i)^2)));
Va=(2+(x1(1,i)*cos(arf)-x(1,i)*sin(arf))*Ga)/(1-x(1,i)^2-x1(1,i)^2);
Sa=(x(1,i)*cos(arf)+x1(1,i)*sin(arf))/(1-(x(1,i)*cos(arf)+x1(1,i)*sin(arf))^2);
f11=-sqrt((x(1,i)-2*x1(2,i))^2+(x1(1,i)+2*x(2,i))^2)/(1-x(1,i)^2-x1(1,i)^2);
f12=3*x(1,i)*Va-Ga*sin(arf)-2*cos(arf)*Sa;
f22=3*x1(1,i)*Va+Ga*cos(arf)-2*sin(arf)*Sa;
fx=f11*f12;
fy=f11*f22;
Fx=-fx;
Fy=-fy;
F=[Fx,Fy]';
%%%%%%%%%%%%%%%%%%%%%
%Q=[0 0 fx 0 0 0 0 0 fy 0 0 0]';
q(:,i+1)=F+Q+M*(a0*x(:,i)+a2*x1(:,i)+a3*x2(:,i))+C*(a1*x(:,i)+a4*x1(:,i)+a5*x2(:,i));
x(:,i+1)=inv(Ke)*q(:,i+1);
x2(:,i+1)=a0*(x(:,i+1)-x(:,i))-a2*x1(:,i)-a3*x2(:,i);
% x1(i,i+1)=a1*(x(i,i+1)-x(i,i))-a4*x1(i,i)-a5*x2(i,i);
x1(:,i+1)=x1(:,i)+a6*x2(:,i)+a7*x2(:,i+1);
% fprintf(fid1,'%5d %15.6e %15.6e %15.6e %15.6e %15.6e %15.6e %15.6e %15.6e %15.6e %15.6e %15.6e %15.6e\n',i,x(i,i+1));
plot(t(i),x(1,i),'k*');
% plot(t,x1(1,i),'ro');
% hold on;
% plot(t,x2(1,i),'go');
% hold on;
i=i+1;
t(i)=t(i-1)+dt;
% plot(t(i),x(1,i));
end
% figure(1)
%plot(t(:),x(1,:),'k*');
% plot(t(i),x(1,i));
% figure(2)
% plot(t,x(7,i));
% figure(3)
% plot(x(1,i),x(7,i));
% hold on;
% fclose(fid1);
哪位高手帮忙写下每步什么意思
yishshibuzhidao
关于hogmatlab源代码和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 05-03解读网页源代码(网站的源代码)[20240503更新]
- 05-03项目实施源代码(源代码开发)[20240503更新]
- 05-03自媒体程序源代码(自媒体程序源代码是什么)[20240503更新]
- 05-03包含人脸识别系统源代码的词条[20240503更新]
- 05-02天龙八部源代码下载(天龙八部游戏源码)[20240502更新]
- 05-02vs2008源代码管理器(vs2015资源管理器)[20240502更新]
- 05-023d试衣间软件源代码(3d虚拟试衣间图)[20240502更新]
- 05-02怎么交易源代码(源码交易网站有哪些)[20240502更新]
- 05-02hibernate的分页查询完整源代码(基于hibernate的分页查询)[20240502更新]
- 05-02源代码小说百度(小说 源代码)[20240502更新]
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接