Monthly Archives: April 2011

Matlab批量处理图像思路

%% Matlab批处理图像框架 %————————————————————————————————– % 此m文件是批量处理图像的框架 % 2009.10.12 shine shuchong1987@sina.com %————————————————————————————————– %% 命令集 t = cd(‘xxxxx’); % dos命令cd重置当前路径,自行设置,其下包含全部待处理文件 allnames = struct2cell(dir);%dos命令dir列出所有的文件,用struct2cell转换为元胞数组 [m,n] = size(allnames); for i= 3:n name = allnames{1,i} %逐次取出文件名 filename = [t,’\’,name]%组成文件名 I = imread(filename);%本人测试了一下,imread要比importdata效率高一些 //Do your own work … Continue reading

Posted in Others | Leave a comment

vb.net access数据库,常用的连接数据库和记录集操作的方法

vb.net中是不是一般都不用adodb连接和操作记录集了呀? 那现在最好的方法是什么呢?有方便效率又高的方法是什么呢? 我看到很多都用 OleDbConnection连接数据库,然后用 OleDbDataAdapter把记录集 把数据复付到dataset里,还有更好的方法吗?最常用,效率最高的是什么呢? 是的,用oledb 毕竟ADO.NET和ADO在设计的思路上存在本质的差异,适应了就好用了. 单从效率和速度考虑,应该使用OleDbDataReader 通过 OleDbCommand.ExecuteReader() 方法获得 DataReader 对象。 因为DataReader对象是ReadOnly,ForwardOnly的。 一次只从数据库取一条记录,对于数据量比较大的操作可以考虑使用DataReader 但是DataReader操作不如DataTable方便。 oledb对access数据库进行操作: Dim objConn As New OleDb.OleDbConnection Dim objComm As New OleDb.OleDbCommand Dim objda As New OleDb.OleDbDataAdapter Dim objds As New DataSet objConn.ConnectionString = “provider=microsoft.jet.oledb.4.0;user;password=;data source=d:\1.mdb” 字串4 objComm.CommandText = “select … Continue reading

Posted in Others | Leave a comment

Read individual variables in CFX

If need to read the such individual variables in CFX as current timestep, current loop and so on, the subroutines  ‘USER_GET_TRANS_INF’ and ‘PEEKI/PEEKR’ are used. (Not ‘USER_GETVAR’). When use PEEKI/PEEKR/PEEKL/PEEKD to get the variables, user should note that which function … Continue reading

Posted in Others | Leave a comment

利用matlab求图片的灰度并利用灰度值绘图

一、求图片的灰度值: I=imread(‘sample.jpg’); !读取图片的RGB值 J=rgb2gray(I);!转换为灰度值 二、利用灰度值绘制图片: imshow(J) 三、绘制等高线 contour(J) contourf(J) 颜色填充

Posted in Others | Leave a comment