- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 安装Linux Ubuntu14.04那点事儿
准备,先给linux分一块空闲硬盘出来。1、下载ubuntu系统包,在中国有不同的镜像站,如中科大镜像站,和163镜像站。到网站相应的目录下,下载相应的系统到电脑上就好。2、使用大白菜或者老毛桃刻录启动U盘。两个功能差不多,都是选择第二个tab“刻录iso”就好。注意,在刻录前,应备份好u盘的数据。3、刻录好后,按下F12、F2或者DEL键(不同的系统,更改boot,可能按不同的键
2014-10-07 19:43:08 641
原创 Matlab函数
inline函数clearclc%% just one parameter, the next two is equivalentmySigmoid = inline('1/(1+exp(-z))');mySigmoid(0)mySigmoid = inline('1/(1+exp(-z))','z');mySigmoid(0)%% when there is more
2014-08-25 19:20:12 591
原创 C++重载
//函数重载:具有相同的函数名,但是函数的参数个数不同,或者参数类型不同#include using namespace std;int calcArea(int x){ cout<<"square-int"<<endl; return x*x;}double calcArea(double x){ cout<<"square-double"<<endl; return
2014-08-23 20:25:59 316
原创 第一个C++类实例
CircleClass.h#include #define PI 3.14159class circle{private: double x; double y; double r; double primeter; double area; void calcPrimeter() { primeter = 2*PI*r; } void calcArea()
2014-08-23 20:02:32 525
原创 Matlab 2010a设置VS2010为编译器
Matlab 2010a设置编译器>> mex -setupPlease choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? n Select a compiler: [1] I
2014-08-21 19:55:58 4388 1
原创 Floyd算法
#include #define NumVertical 4#define Inf 0xFFFint Dist[NumVertical][NumVertical] = {{0,5,Inf,7},{Inf,0,4,2},{3,3,0,2},{Inf,Inf,1,0}};int path[NumVertical][NumVertical];int Floyd(){ for (int
2014-08-14 16:17:04 311
原创 迪杰斯特拉算法实现
#include #define INFINITE 0x0FFF#define NumVertice 10int shortestDist[NumVertice];int prevVertices[NumVertice];int neighborDist[NumVertice][NumVertice] = {{0,5,4,2,INFINITE,INFINITE,INFINITE,I
2014-08-14 13:53:14 480
原创 动态规划示例五
#include #define NumVertices 5 //无向图中的顶点数#define Money 20 //身上的钱数#define tooMuch 1000 //在此过程中,tooMuch可以作为无穷大#define isVisted true //某个特定剩余多少钱的节点是否被访问过//解决带限制条件的的动态规划问题int main(){ int Cost[N
2014-08-13 21:43:58 436
原创 动态规划示例四
捡苹果问题#include #define NumRow 4#define NumCol 5int max(int a,int b){ return (a > b) ? a : b;}int PickApple(int appleMatrix[NumRow][NumCol]){ int rowIndex, colIndex; int appleNumbers[N
2014-08-13 11:33:27 390
原创 动态规划示例三
int LIS(int d[], int n){ int *B = new int[n]; int i, left, right, mid, len = 1; B[0] = d[1]; //为了和上面的一致,我们从1开始计数吧:) for(i = 2; i <= n; ++i){ left = 0, right = len; whil
2014-08-12 11:47:19 417
原创 动态规划示例
//这里展示动态规划思想,是一个简单的找零钱问题,总共有三种面额:1,3,5,某个任意面额由其组成的最小个数。#include int main(){ int DominationArray[100]; //这个数组用于存储每个面额对应的最小个数 int EachDomination[3]={1,3,5};//常数数组,共三种面值 int ArrayIndex; //用于外循环 in
2014-08-11 23:02:15 390
机器学习的线性回归的Matlab代码实现
2014-08-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人