虫虫首页|资源下载|资源专辑|精品软件
登录|注册

plot

  • 批处理感知器算法

    批处理感知器算法的代码matlab w1=[1,0.1,1.1;1,6.8,7.1;1,-3.5,-4.1;1,2.0,2.7;1,4.1,2.8;1,3.1,5.0;1,-0.8,-1.3;     1,0.9,1.2;1,5.0,6.4;1,3.9,4.0]; w2=[1,7.1,4.2;1,-1.4,-4.3;1,4.5,0.0;1,6.3,1.6;1,4.2,1.9;1,1.4,-3.2;1,2.4,-4.0;     1,2.5,-6.1;1,8.4,3.7;1,4.1,-2.2]; w3=[1,-3.0,-2.9;1,0.5,8.7;1,2.9,2.1;1,-0.1,5.2;1,-4.0,2.2;1,-1.3,3.7;1,-3.4,6.2;     1,-4.1,3.4;1,-5.1,1.6;1,1.9,5.1]; figure; plot(w3(:,2),w3(:,3),'ro'); hold on; plot(w2(:,2),w2(:,3),'b+'); W=[w2;-w3];%增广样本规范化 a=[0,0,0]; k=0;%记录步数 n=1; y=zeros(size(W,2),1);%记录错分的样本 while any(y<=0)     k=k+1;     y=a*transpose(W);%记录错分的样本     a=a+sum(W(find(y<=0),:));%更新a     if k >= 250         break     end end if k<250     disp(['a为:',num2str(a)])      disp(['k为:',num2str(k)]) else      disp(['在250步以内没有收敛,终止']) end %判决面:x2=-a2*x1/a3-a1/a3 xmin=min(min(w1(:,2)),min(w2(:,2))); xmax=max(max(w1(:,2)),max(w2(:,2))); x=xmin-1:xmax+1;%(xmax-xmin): y=-a(2)*x/a(3)-a(1)/a(3); plot(x,y)

    标签: 批处理 算法matlab

    上传时间: 2016-11-07

    上传用户:a1241314660

  • 重力异常正演MATLAB程序

    %球体 close all; G=6.67e-11; R=2;%球体半径 p=4.0;%密度 D=10.0;%深度 M=(4/3)*pi*R^3*p;%质量 x=-20:1:20; g=G*M*D./((x.^2+D^2).^(3/2)); Vxz=-3*G*M*D.*x./((x.^2+D^2).^(5/2)); Vzz=G*M.*(2*D^2-x.^2)./((x.^2+D^2).^(5/2)); Vzzz=3*G*M.*(2*D^2-3.*x.^2)./((x.^2+D^2).^(7/2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('球体重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %水平圆柱体 close all G=6.67e-11; p=10.0;%线密度 D=100.0;%深度 x=-200:1:200; g=G*2*p*D./(x.^2+D^2); Vxz=4*G*p*D.*x./(x.^2+D^2).^2; Vzz=2*G*p.*(D^2-x.^2)./(x.^2+D^2).^2; Vzzz=4*G*p.*(D^2-3.*x.^2)./((x.^2+D^2).^3); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('水平圆柱体重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %垂直台阶 G=6.67e-11; p=4.0;%密度 h1=50.0;%下层深度 h2=40.0;%上层深度 x=-100:1:100; g=G*p.*(pi*(h1-h2)+x.*log((x.^2+h1^2)./(x.^2+h2^2))+2*h1.*atan(x./h1)-2*h2.*atan(x./h2)); Vxz=G*p.*log((h1^2+x.^2)./(h2^2+x.^2)); Vzz=2*G*p.*atan((x.*(h1-h2))./(x.^2+h1*h2)); Vzzz=2*G*p.*x*(h1^2-h2^2)./((h1^2+x.^2).*(x.^2+h2^2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('垂直台阶重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %倾斜台阶 G=6.67e-11; p=4.0;%密度 h1=50.0;%下层深度 h2=40.0;%上层深度 a=pi/6;%倾斜角度 x=-500:1:500; g=G*p.*(pi*(h1-h2)+2*h1.*atan((x+h1*cot(a))./h1)-2*h2.*atan((x+h2*cot(a))./h1)+x.*sin(a)^2.*log(((h1+x.*sin(a).*cos(a)).^2+x.^2.*sin(a)^4)./((h2+x.*(sin(a)*cos(a))).^2+x.^2.*sin(a)^4))); Vxz=G*p.*(sin(a)^2.*log(((h1*cot(a)+x).^2+h1^2)./((h2*cot(a)+x).^2+h2^2))-2*sin(2*a).*(atan((h1/sin(a)+x.*cos(a))./(x.*sin(a)))-atan((h2/sin(a)+x.^cos(a))./(sin(a).*x)))); Vzz=G*p.*(0.5*sin(2*a)^2.*log(((h1*cot(a)+x).^2+h1^2)./((h2*cot(a)+x).^2+h2^2))+2*sin(a)^2.*(atan((h1/sin(a)+x.*cos(a))./(x.*sin(a)))-atan((h2/sin(a)+x.*cos(a))./(x.*sin(a))))); Vzzz=2*G*p*sin(a)^2.*((x+2*h2*cot(a))./((h2*cot(a)+x).^2+h2^2)-(x+2*h1*cot(a))./((h1*cot(a)+x).^2+h1^2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('倾斜台阶重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %铅锤柱体 G=6.67e-11; p=4.0;%密度 h1=50.0;%下层深度 h2=40.0;%上层深度 a=3;%半径 x=-500:1:500; g=G*p.*((x+a).*log(((x+a).^2+h1^2)./((x+a).^2+h2^2))-(x-a).*log(((x-a).^2+h1^2)./((x-a).^2+h2^2))+2*h1.*(atan((x+a)./h1)-atan((x-a)./h1))-2*h2.*(atan((x+a)./h2)-atan((x-a)./h2))); Vxz=G*p.*log((((x+a).^2+h1^2).*((x-a).^2+h2^2))./(((x+a).^2+h2^2).*((x-a).^2+h1^2))); Vzz=2*G*p.*(atan(h1./(x+a))-atan(h2./(x+a))-atan(h1./(x-a))+atan(h2./(x-a))); Vzzz=2*G*p.*((x+a)./((x+a).^2+h2^2)-(x+a)./((x+a).^2+h1^2)-(x-a)./((x-a).^2+h2^2)+(x-a)./((x-a).^2+h1^2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离/m') ylabel('重力异常值') title('铅垂柱体重力异常') grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on

    标签: MATLAB 重力 程序

    上传时间: 2019-05-10

    上传用户:xiajiang

  • 实用模拟电路设计 (Marc T. Thompson)

    本书是 Marc Thompson 博士 20 年模拟电路设计和教学经验的总结,讲述了模拟电路与系统设计中常用的直观分析方法。本书提出了“模拟电路直观方法学”,力图帮助学生和设计人员摆脱复杂的理论推导与计算,充分利用直观知识来应对模拟电路工程设计挑战。全书共分为 16 章,内容涵盖了二极管、晶体管、放大器、滤波器、反馈系统等模拟电路的基本知识与设计方法。本书大纲第 1 章与第 2 章为介绍性材料。第 1 章是本书的引言,同时介绍了模拟电路设计的发展动机,其中引用了一些精选的历史事件。第 2 章讲述后续章节中用到地重要的信号处理概念,以使读者们能够跟上作者的思路。第 3 章至第 8 章讲述双极性器件的物理学原理、双极性结型晶体管 (bipolar junction transistor, BJT) 、晶体管放大器,以及用于带宽估计与开关速度分析的近似技术。第 9 章讲述 CMOS 管和 CMOS 管放大器的基础知识。前面章节介绍的用于放大器设计的带宽估计技术也同样适用于 CMOS 管器件。第 10 章讲述 晶体管的开关效应。晶体管是如何实现导通和关闭呢?又如何估计它的开关速度呢?第 11 章回顾反馈系统 (feedback system) 的基本知识以及设计稳定反馈系统的伯德图 / 相位裕度方法 (Bod plot / phase margin) 。第 12 章和第 13 章讲述实际运算放大器的设计、使用和限制,包括电压反馈 (voltage-feedback) 以及电流反馈 (current-feedback) 放大器。第 14 章讲述模拟低通滤波器设计的基本知识,包括巴特沃思 (Butterworth) 、切比雪夫 (Chebyshev) 、椭圆 (elliptic) 以及贝塞尔 (Bessel) 滤波器的无源梯形实现和胡源实现。第 15 章讲述实际电路设计问题,比如 PCB 版图设计规则、无源器件的使用和限制等。第 16 章是一些有用的设计技术和设计技巧的大杂烩,这些内容又不适合放在其他章节,所以作为独立的章节进行讲述。一些说明性的分析问题以及 MATLAB 和 SPICE 设计示例点缀在全书的字里行间,以帮助读者理解本书的内容。

    标签: 模拟电路

    上传时间: 2022-02-13

    上传用户:zhengtiantong

  • Ansoft0MaxwellV12电机瞬态分析教程

    This Getting Started Guide is written for Maxwell beginners and experienced users who would like to quickly re familiarize themselves with the capabilities of MaxwelL.This guide leads you step-by-step through solving and analyzing the results of a rotational actuator magnetostatic problem with motion By following the steps in this guide, you will learn how to perform the following tasks Modify a models design parameters y Assign variables to a model's design parameters.Specify solution settings for a design Validate a designs setupRun a maxwell simulation v plot the magnetic flux density vecto v Include motion in the simulation本《入门指南》是为希望快速重新熟悉MaxwelL功能的Maxwell初学者和有经验的用户编写的。本指南将引导您逐步解决和分析旋转致动器静运动问题的结果。按照本指南中的步骤,您将学习如何执行以下任务。修改模型设计参数y将变量分配给模型的设计参数。指定设计的解决方案设置验证设计设置运行maxwell模拟v绘制磁通密度vecto v在模拟中包含运动

    标签: ansoft maxwell

    上传时间: 2022-03-09

    上传用户:zinuoyu

  • 学习用PSPICE设计模电实验

    1.创建一个新项目:激活Design Manager,在菜单File中选择New Workspace,然后填入项目名称expl。2.输入网单文件:在Tools菜单中选择TextEdit,输入如下所示的网单文件。3.保存文件:将文件命名为expl.cir。4.对电路进行模拟:在Tools菜单中选择PspiceA/D,再在PspiceA/D的File菜单中选择Open,打开已保存过的输入文件expl.cir。5.检查出错:如果文件中出现了语法错误,PspiceA/D就会弹出错误提示框,并运行Message Viewer,告诉用户错误信息。如果输入文件没有语法错误,PspiceA/D就显示正确模拟的对话框,如图3-3类似,从图中可读出电路标题、元器件个数以及计算中所耗内存信息。6.查看输出文件:在File菜单中选择Examine 0utput,就可以通过Text Editor来浏览输出文件。输出文件中的各节点电压如下所示。由此可得出如下所示的静态工作点参数:Vw=2.9646V,Vow=7.1878-2.1919=4.9959V,Tg=Va/R.=2.1919/2.3=0.953mA。7.观察输出波形:在PspiceA/D的File菜单中选择Run Probe,或者在Design Manager 中选择Tools下的Probe,都可以调出Probe。Probe自动设置横坐标,纵坐标必须通过手动添加。在菜单Trace中选择Add,在Add Traces对话框的Trace Expression中输入V(6)/V(1),测量放大倍数。8.在Probe中,单击plot菜单下的Add YAxis,增加一个新纵轴。9.单击Trace菜单下的Add,在Trace Expression中输入V(1)/I(V1),测量输入电阻,输出曲线如图2-2所示。

    标签: pspice

    上传时间: 2022-07-02

    上传用户:sheng199241