加载中…
  
博文

原文:http://blog.sina.com.cn/s/blog_5e16f1770100lp7u.html

1.首先添加如下内容:

clc;
clear all;
close all;

x1(1,1)=1.8796; x1(1,2)=1.8041;
x1(2,1)=2.6801; x1(2,2)=2.7526;
x1(3,1)=3.6284; x1(3,2)=1.3313;
x1(4,1)=4.7302; x1(4,2)=3.0267;
x1(5,1)=5.7865; x1(5,2)=0.3089;
x1(6,1)=7.1831; x1(6,2)=2.9453;
x1(7,1)=7.2395; x1(7,2)=3.6268;
x1(8,1)=8.0763; x1(8,2)=4.9714;
x1(9,1)=9.9172; x1(9,2)=3.9551;
x1(10,1)=11.7397; x1(10,2)=3.9500;
x1(11,1)=12.8685; x1(11,2)=2.4619;
x1(12,1)=12.5289; x1(12,2)=3.5313;
x1(13,1)=13.3206; x1(13,2)=4.4376;
x1(14,1)=15.7457; x1(14,2)=0.9094;
x1(15,1)=15.4758; x1(15,2)=5.2898;
x1(16,1)=17.2917; x1(16,2)=5.2197;
x1(17,1)=18.9338; x1(17,2)=3.7324;
x1(18,1)=19.3299; x1(18,2)=2.0778;
x1(19,1)=20.7408; x1(19,2)=5.2698;
x1(20,1)=20.0199; x1(20,2)=3.5670;
x1(21,1)=21.2740; x1(21,2)=4.7658;
x1(22,1)=23.6375; x1(22,2)=3.3211;
x1(23,1)=23.8603; x1(23,2)=6.1293;

# -*- coding: utf-8 -*-

'''

Created on Thu May 30 21:17:42 2013


@author: Timchen525


'''

import numpy as np

import matplotlib.pyplot as plt

import scipy as sc

 

功能简介

uicontrol 创建用户界面控件对象。
分类: 数理逻辑类

原理见我的博文中的c版本:

clc
clear all
A=imread('D:\test.bmp');
figure(1)
imshow(A)
[w,l]=size(A);
B=zeros(w,l);
%%%%%%%%%对图形进行预处理包括255处理为1,还有加上全1的边框
for i=1:w
    for j=1:l
        if(A(i,j)==255)
            B(i,j)=1;
        else
            B(i,j)=0;
        end
    end
end
mark=zeros(w,l);
temp=0;
for i=2:w-1
    for j=2:l-1
        %%step1: weather p is 0,that is ,p is not background
        if(B(i,j)~=0)
            continue;
&

标签:

杂谈

分类: 程序语言类
由于公式不能复制所以原文见http://wenku.baidu.com/view/1c5f16da240c844769eaee41.html?st=1

K-均值聚类算法

1.初始化:选择c个代表点

2.

标签:

杂谈

分类: 程序语言类

 matlab串口通信基础讲义

①支持基于串行接口(RS-232RS-422RS-485)、GPIB总线(IEEE2488HPIB标准)、VISA总线的通信;

标签:

it

分类: 程序语言类

function [R_best,L_best,L_ave,Shortest_Route,Shortest_Length]=ACATSP(C,NC_max,m,Alpha,Beta,Rho,Q)
%%===================================================================
%% ACATSP.m
%% Ant Colony Algorithm for Traveling 

  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有