Script language
文章平均质量分 55
shanno
一切尽在不言中
展开
-
Matlab 技巧小结
1. 在知道矩阵的列数,却不知道行数的情况下:array = zeros(0, column);2. 注释多行代码的两种方法:a. ctrl + r;并用ctrl+t来撤销注释;b. if logical(0) ... end,在注释行较多的情况下比较方便;3. 强制终止运行:ctrl+c 4. 代码对齐:ctrl + i 5. 求log(x),或1/x时,x = x +原创 2009-12-29 10:47:00 · 833 阅读 · 1 评论 -
MEX文件
Section 8: The ingredients of a MEX-fileAll MEX-files must include four things:#include mex.h (C/C++ MEX-files only) mexFunction gateway in C/C++ (or SUBROUTINE MEXFUNCTION in Fortran)The mxAr转载 2010-04-23 22:36:00 · 3397 阅读 · 0 评论 -
Lua学习笔记——Lua作为库嵌入到C中
/*C++程序接收用户输入的字符串,把该字符串作为Lua的一个chunk送到stack中编译执行。*/#include #include #include int main(int argc, char* argv[]){ char buff[256]; int error = 0; lua_State* L=lua_open(); if(0 == L){原创 2012-01-16 19:36:57 · 2514 阅读 · 0 评论 -
lua学习笔记之栈
-1|___|4-2|___|3 -3|___|2-4|___|1/*堆栈结构,从栈底看,从1开始(右边的数字);从栈顶看以-1开始(左边的数字)*//*栈: 基本操作栈中可存放任意类型的数据,lua_push*函数将指定类型的元素入栈,lua_is*判断栈顶元素的类型,lua_to*获取栈顶元素,lua_pop将栈顶元素退栈,lua_settop指定新的栈顶位置*/原创 2012-01-19 10:40:45 · 1277 阅读 · 1 评论 -
Lua学习笔记
XXX类型的语言 |--静态类型 | |--说明:编译期数据类型是固定的语言,它要求你在使用变量之前声明它的数据类型。Java/C |--动态类型 | |--说明:执行期才去发现数据类型的语言。Python/VBScript |--强类型 |原创 2012-01-04 16:14:43 · 742 阅读 · 0 评论 -
Python学习笔记——切片操作
#slice[start:stop:step]# 0 represent the left end of the sequence, -1 represents the right end of the sequence.mystring = "my string"#if the sign of the step is negative, then#the default valu原创 2012-02-25 21:45:07 · 600 阅读 · 0 评论