rprt.net
当前位置:首页 >> mAtlAB编程实例100篇 >>

mAtlAB编程实例100篇

1-32是:图形应用篇33-66是:界面设计篇67-84是:图形处理篇85-100是:数值分析篇实例1:三角函数曲线(1)function shili01h0=figure('toolbar','none', 'position',[198 56 350 300], 'name','实例01');h1=axes('parent',h0, 'visible','off');x=-pi:

%半波\全波、1.5波,2波天线阵子方向性图 k=2;%振子数量 l=1/4; delta=pi/200; th=0:delta:pi; phi=0:delta:2*pi; [phi,th]=meshgrid(phi,th); F=(cos(k*l*pi.*cos(th))-cos(k*l*pi))./sin(th); X = F.*sin(th).*cos(phi); Y = F.*sin(th).*sin(phi); Z = F.*cos(th);

a=[0.150,0.025,0.150,0.025,0.300,0.025,0.300,0.025,0.200,0.025,0.200,0.025,0.130; 0,0.025,0.025,0.025,0.025,0.025,0.025,0.025,0.025,0.025,0.025,0.025,0.025]; m=[153.15264,0,0,0,0]; n=[7.85398*10^9/0.2,0,0,0,0]; for i=1:13 b(1,i)=polyval(

入门的话先学习下面的1,矩阵输入求解 还有 符号求解2,绘图,二维和三维3,差值与拟合4,多项式求解5,解方程组留下邮箱我给你发ppt 或者word教程里面有很多

时钟1:(第一个程序)hfig=figure('visible','off');set(hfig,'NumberTitle','off');set(hfig,'name','My Clock');set(hfig,'MenuBar','none');set(hfig,'color',[0.5 0.7 0.3]);set(hfig,'visible','on');A=linspace(0,6.3,1000);x1=8*cos(A);y1=8*sin(A);x2=7*cos(A);y2=7*sin(

clear; n=input('请输入向量的长度n:') L=zeros(1,n); for i=0:(n-2) m=round(rand(1)); L(i+1)=[m]; i=i+1; end L 运行后:请输入向量的长度n:12 n =12 L =0 1 0 0 0 0 1 0 1 1 1 0 该向量L为得到的随机0-1向量 注:运行的时候会让你输入向量的长度n.你就根据自己的需要输入一个正整数即可.

我最近也学了一点,主要是用于BP网络上面的编程,这里有个例子你先看看!X = [0 1; 0 1]; clusters = 5; points = 10; std_dev = 0.05; P = nngenc(X,clusters,points,std_dev);plot(P(1,:),P(2,:),'+r');title('输入样本向量');xlabel('p(1)');ylabel('p(2)');

function isInPoly(varargin)% 函数功能:判断二维空间点是否在三角形或四边形内% 举例说明:% isInPoly([2,5],[3,4],[5,5],[6,8],1)% isInPoly([1,2],[0,5],[3,3],[1,1],0)% isInPoly([0,2],[2,5],[1,3],[8,2],[2,1],0)% isInPoly([5,2],[1,5],[2,2],[3,8],[8,0],1)if nargin

1.32X32映射到8X8的函数是什么?2.a是怎么生成的?3.b1到b100映射到8X8矩阵的函数是什么?4.差值和是什么?是差值绝对值求和还是什么?5.为什么前边说的是“差值和”,后一句话又说把差值从大到小排?到底是差值还是差值和?6.随机数和Ci相差多少的时候算是被选择?如果要求相等才是被选择,那概率太小了,因为matlab默认的随机数可以超过1e-15精度,Ci中有一个能和取得的随机数相等的概率就十分渺茫,更别说什么次数最多了.7.根据你的意思,C始终是一个100个元素的矩阵,他怎么才算稳定?你所谓的水平是什么?你先把上边这些问题说清楚再来问问题吧,否则你给100000分也没人帮得了你

有三种方法:(1)用hold on和hold off,画好第一幅图后,用hold on 语句就可以接着在该坐标系下画出其他的曲线图形,画完后再用hold off结束例如% 函数y=sin(x)x=linspace(0,pi,100);y=sin(x)plot(x,y,'*k');hold onx=linspace(2*pi,4*pi,100)y=sin(x)

网站首页 | 网站地图
All rights reserved Powered by www.rprt.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com