
matlab 代码
nbu04william
come on baby. believe yourself.
展开
-
我的 kmeans matlab 代码
最近,接触了一下聚类算法。其中最简单最经典的莫过于 kmeans 算法。我了解了算法之后,着手编写了 matlab 代码。我的代码只有20几行,比起网上的很多代码都要简洁。 function [cls,ctr]=kmeans(data,K,tol) % Kmeans % input: data K tol % output: cls: clusters, ctr: centroids % exa原创 2015-01-24 14:14:01 · 1736 阅读 · 0 评论 -
matlab LMS algorithm
In this article, I show the LMS algorithm in MATLAB. Following is the source codes. You can copy it and then run it. This algrithm is invented by B Widrow and M Hoff, in 1960. % mylms.m % LMS algor原创 2015-03-27 19:30:48 · 905 阅读 · 0 评论 -
参数自适应的单层 bp 神经网络
在经典的 BP 神经网络的基础上,加入两个可变参数,分别表示激活函数(非对称)的倾斜度和值域范围。这两个参数和神经网络权值矩阵一样可以自动调整。也可以将此方法应用于使用对称的激活函数的神经网络。原创 2015-04-06 20:14:34 · 761 阅读 · 0 评论 -
三层 BP 神经网络 matlab 实现
最近研究神经网络。BP网络是最经典最常用的神经网络。Matlab 有专门的工具箱用来实现 BP 算法。我用matlab语言重新实现BP算法,以便加深对该算法的理解程度。程序有点粗糙,只是为了实现算法。当然可以加上一些绘图命令来可视化神经网络学习过程。 % BP net R^m->R^h->R^n % sigmoid=@(x)1./(1+exp(-x)); % input : X,T %x1=l原创 2015-04-24 14:58:18 · 6280 阅读 · 0 评论 -
matlab一维搜索,用进退法确定搜索区间
一维搜索是优化算法的基础部分。搜索极小值首先要确定搜索区间,最常用的区间搜索就是进退法。根据进退法的本意,我重新优化了进退法搜索算法。如果有什么不对的地方,请网友们提出来。 function [a,b]=searchInterval(f,x0,h,t) % Function: % searchInterval % Input: % f: function; %原创 2015-04-26 10:47:36 · 5229 阅读 · 0 评论 -
matlab 轻松绘制出曲线的动画效果
下面的程序能画出动画效果。非常实用,注意语法,和line类似,只是前两个必须为xdata与ydatafunction h=animline(xdata, ydata, varargin) % input: % varargin: properties in line or % time: time from [xdata(k),ydata(k)] to [xdata(k+1),原创 2016-03-27 19:02:28 · 12800 阅读 · 6 评论