getdata.m

来自「matlab进行不确度计算」· M 代码 · 共 34 行

M
34
字号
function [AA,n]=GetData(strDatabase) 
%GetData Imports data into Matlab from a database. 
timeoutA=logintimeout(5) ;

% Connect to a database. 
%打开数据源 strDatabase 
connA=database(strDatabase,'','') ;

% if connA.AutoCommit=='off'
%     AA=[];
%     n=0;
%     return;
% end
% Open cursor and execute SQL statement. 
%执行SQL查询语句 
cursorA=exec(connA,'select input_data from input2'); 

% Fetch the all rows of data. 
%获取所有行数据 
cursorA=fetch(cursorA) ;

%获取行数
n = rows(cursorA);

% Return the data. 
%数据
AA=cursorA.Data{:};

AA= AA';

% Close the cursor and the connection. 
%关闭 
close(cursorA) ;
close(connA);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?