本文檔介紹了如何使用各種內(nèi)嵌工具,函數(shù)和其他一些小技巧來加強(qiáng)使用matlab的速度和效率,是廣大愛好者必讀的文檔。具體內(nèi)容請(qǐng)參閱文檔。
Learn how to use the Profiler tool, vectorized functions, and other tricks to writing efficient MATLAB code. This article includes how to convert any array into a column vector, bounding a value without if statements, and repeating/tiling a vector without repmat.
Contents:
* The Profiler
* Array Preallocation
* JIT Acceleration
* Vectorization
* Inlining Simple Functions
* Referencing Operations
* Numerical Integration
* Signal Processing
* Miscellaneous Tricks
自然對(duì)界,Win32平臺(tái)下的微軟C編譯器(cl.exe for 80x86)在默認(rèn)情況下采用如下的對(duì)齊規(guī)則:任何基本數(shù)據(jù)類型T的對(duì)齊模數(shù)就是T的大小,即sizeof(T)。比如對(duì)于double類型(8字節(jié)),
This GUI is an updated and enhanced version of the “StructBrowser” utility submitted to MatLab Central in May 2003. It comes with new interface and an enhanced display. It uses Microsoft TreeView control to display and explore any kind of MatLab structures. The CRC ExploreStruct was designed to expose the contents of the array struct to any depth and plot any of the components. This tool is very useful for programmers using structures in their code
The concept of the Altera Nios II embedded processor implementation inside Field Programmable Gate Array [FPGA] of the CCD camera for the “Pi of the Sky” experiment is presented. The digital board of the CCD camera, its most important components, current implementation of firmware [VHDL] inside the FPGA and the role of external 8051 microcontroller is briefly described. The main goal of the presented work is to get rid of the external microcontroller and to design new system with Nios II processor built inside FPGA chip. Constraints for implementing the design into the existing camera boards are discussed. New possibilities offered by a larger FPGA for next generation of cameras are considered.
The AT24C512 provides 524,288 bits of serial electrically erasable and programmable
read only memory (EEPROM) organized as 65,536 words of 8 bits each. The device鈥檚
cascadable feature allows up to four devices to share a common two-wire bus. The
device is optimized for use in many industrial and commercial applications where lowpower
and low-voltage operation are essential. The devices are available in spacesaving
8-pin PDIP, 8-lead EIAJ SOIC, 8-lead JEDEC SOIC, 8-lead TSSOP, 8-lead
Leadless Array (LAP), and 8-lead SAP packages. In addition, the entire family is available
in 2.7V (2.7V to 5.5V) and 1.8V (1.8V to 3.6V) versions.
FIBPlus is a component suite intended for work with InterBase. It is direct, fast and flexible InterBase connectivity for Delphi, C++ Builder, Ada and Kylix. FIBPlus supports Delphi 5-7, Delphi 2005, Delphi 2006, Delphi 2007, C++ Builder 5-6, C++ Builder 2006, C++ Builder 2007, Kylix 3, gnat-3.15p, gnat2006 GPL, and all versions of InterBase 4.x-7.x, InterBase 2007 and Firebird 1.x-2.x.
Using FIBPlus in your applications you do not need to install any additional software except for InterBase Client Software. FIBPlus supports all special InterBase features such as array-fields, event alerters, BLOB-fields, etc.
FIBPlus is a native component set and its evaluation versions are distributed partially in sources.
Registering FIBPlus you get full sources of components and technical support
procedure senddata
var
i:integer commflg : Boolean
begin
commflg:=true
for i:=1 to 8 do
begin
if not fcomm comml writecommdata(sendbutter,i) then
begin
Commflg=false
break
end
end
end
(4) 接收數(shù)據(jù)
在編寫基于串口的計(jì)算機(jī)工業(yè)測(cè)控時(shí),通常需要由下位機(jī)向PC機(jī)發(fā)送數(shù)據(jù)以使PC機(jī)了解系統(tǒng)的測(cè)試數(shù)據(jù)或下位機(jī)的運(yùn)行狀態(tài),并進(jìn)而控制下位機(jī)的行為。利用Spcomm串口控件接收下位機(jī)發(fā)送的數(shù)據(jù)信息的示例代碼如下:
//事件驅(qū)動(dòng)方式接收數(shù)據(jù)程序
procedure TForm1.CommlReceiveData(Sender:Tobject Buffer:Pointer bufferLength:Word)
var
receivedata:array of byte
begin
sleep(100) //等待100ms,保證接收到所有數(shù)據(jù)
move(buffef ,receivedata,bufferlength)
//將接收緩存區(qū)中的數(shù)據(jù)轉(zhuǎn)移到數(shù)組中
……
end
(5) 關(guān)閉串口
在系統(tǒng)開發(fā)中,應(yīng)注意在不使用串口時(shí)應(yīng)及時(shí)關(guān)閉串口,釋放系統(tǒng)資源,否則可能會(huì)影響系統(tǒng)的其它應(yīng)用。關(guān)閉串口的代碼如下:
procedure TForm1.FormClose ( Sender TObj ect:var Action:TCIoseAction )
begin
comml.StopComm
end