科学网

 找回密码
  注册
科学网 标签 test 相关日志

tag 标签: test

相关日志

期末英语口语考试—How to educate a child?
热度 1 jay1060201001 2011-6-1 09:32
We will take the English final test this morning.The teacher assigned each team a topic,our team's topic is "how to educate a child?".well,that's a good question.Here I want express my own opinoin on this topic. First of all,the importance of education can not be too much emphasized.Because it is closely connected with the future of our nation. Education help us to developourscience and technology, education improvethe people's quality ,and it's the education help us lead a better life.In my piont of view,children's education plays the most important role in a man's life.To educate a child well,parents are their children's best teachers.because of this,in the family,the parents should create a good atmosphere ,they must set a good example to their children. Secondly,the children's chioce should be amply respected.parents must give their children enough personal space and freedom,which is very important in the westen education.while in china,it has always been overlooked . Finally,a famousphilosopher once said:"edcation is the power of awakening consciousness",I couldn't agree more! The children themselves should form a good habit,it has a close relationship with the family 、 school and society.Here I want to say,education is not only the parents' responsibility,but the every member of our nation!
6585 次阅读|2 个评论
今后本博主要多用英文写作,提升英文能力,各位大侠多多指教!
热度 5 jay1060201001 2011-5-30 11:31
When I read this bolg this morning ( http://blog.sciencenet.cn/home.php?mod=spaceuid=569569do=blogid=448000 ) It suddenly downed on me that why couldn't I write the blog in English! I have always been learning English very hard,I passed the college English Bet 4 test when I was a fresh man ,and then got through the Bet 6 test in the following year.Since I became a postgraduate ,because my subject is logistics engineering ,I found that English is more important for me.So I begun to learn English harder then ever before.I am mad about English now. IreadEnglish loudly in the morning ,andlisten the BBC or VOA materialstored in mymp3 player beforegoing to sleep.In a word,I have pieced together all my spare time to learn English well. Now,in the following passage,I'll introduce my learning method: Fisrtly,I have been reciting the new concept English 3 last year .Though I had learnt the textbook when I was a undergraduate .However,I have almost forgot all of the passages I acquinted.Through persistent hard work,I can recite 40 passages very fluently now,and I hope Secondly,To improve my listening ,Ilistenend theVOA special English at first .After that,I begun to listen VOA standard and BBC.Though it's very hard to appreciate all the contents of the liatening material,you can listen it over an over again until you get the every meaaring of the sentence,even the every meaning of the word.As the old saying goes:practice makes perfect.Only through persistent effort can we improve our English. Finally,I want to say the most important thing in learning English.To learn English,you must make it become part of your life,you muststudy English with full of passion,and you must study English with great interest.There is no shortcut on the road to learn English.Here I want to cite the chinese old saying as a conclusion :Diligence is the path to the mountain of knowledge,hard-working is the boat to the endless sea of learning.(书山有路勤为径,学海无涯苦作舟)
4324 次阅读|7 个评论
matlab中的sfunction的用法(C语言)——修改
tangxh 2011-5-13 16:37
创建一个有1输入(2维),2输出(1维),3个参数,还有全局变量的s-function。 1.新建sfunction的C语言文件 打开simulink,点击User-DefinedFunctions里面的S-FunctionExamples。这个里面有多个语言版本的模板,有C,C++,Ada,Fortran和M语言的版本,其实都大同小异,只要了解几个函数就很容易使用了。 选择C语言的版本:从S-function模块中选择C-fileS-functions里面的BasicC-MEXtemplate。打开后,另存为自己的模块名字,如test.c。 下面我们来分析代码: #defineS_FUNCTION_NAMEtest//这里把文件名sfuntmpl_basic修改为test #defineS_FUNCTION_LEVEL2 #include"simstruc.h" //程序里面要用到的头文件在这里引用,如“math.h”等。 floatglobal_var;//定义全局变量 staticvoidmdlInitializeSizes(SimStruct*S) { //这个函数用来设置输入、输出和参数的。 ssSetNumSFcnParams(S,3);/*设置参数个数,这里为3*/ if(ssGetNumSFcnParams(S)!=ssGetSFcnParamsCount(S)){ return; } ssSetNumContStates(S,0);//设置连续状态的个数,缺省为0; ssSetNumDiscStates(S,0);//设置离散状态的个数,缺省为0; if(!ssSetNumInputPorts(S,1))return;//设置输入变量的个数,这里为1 ssSetInputPortWidth(S,0,2);//设置输入变量0的维数为2 ssSetInputPortRequiredContiguous(S,0,true);//设置input0的访问方式,true就是临近访问,这样指针的增量后就可以直接访问下个input端口了。 ssSetInputPortDirectFeedThrough(S,0,1);//设置输入端口的信号是否mdlOutputs函数中使用,这儿设置为true。 if(!ssSetNumOutputPorts(S,2))return;//设置输出变量的个数 ssSetOutputPortWidth(S,0,1);//设置输出变量0的维数为1维 ssSetOutputPortWidth(S,1,1);//设置输出变量1的维数为1维 ssSetNumSampleTimes(S,1);//设置采样时间,此处为1。 ssSetNumRWork(S,0);//不要修改 ssSetNumIWork(S,0); ssSetNumPWork(S,0); ssSetNumModes(S,0); ssSetNumNonsampledZCs(S,0); ssSetOptions(S,0); //下面可以写全局变量的初始化程序 global_var=1; } staticvoidmdlInitializeSampleTimes(SimStruct*S) { ssSetSampleTime(S,0,CONTINUOUS_SAMPLE_TIME);//可以通过修改这个,修改s函数的采样周期 ssSetOffsetTime(S,0,0.0); } #defineMDL_INITIALIZE_CONDITIONS/*Changeto#undeftoremovefunction*/ #ifdefined(MDL_INITIALIZE_CONDITIONS) staticvoidmdlInitializeConditions(SimStruct*S)//暂时不要修改 { } #endif/*MDL_INITIALIZE_CONDITIONS*/ #defineMDL_START/*Changeto#undeftoremovefunction*/ #ifdefined(MDL_START) staticvoidmdlStart(SimStruct*S)//暂时不要修改 { } #endif/*MDL_START*/ staticvoidmdlOutputs(SimStruct*S,int_Ttid)//这里填入相关的运算、算法等 { real_T*para1=mxGetPr(ssGetSFcnParam(S,0)); real_T*para2=mxGetPr(ssGetSFcnParam(S,1)); real_T*para3=mxGetPr(ssGetSFcnParam(S,2)); constreal_T*u=(constreal_T*)ssGetInputPortSignal(S,0); real_T*y1=ssGetOutputPortSignal(S,0); real_T*y2=ssGetOutputPortSignal(S,1); y1 =u *para1 +u *para2 ; y2 =u *para3 +u *para1 ; } #defineMDL_UPDATE/*Changeto#undeftoremovefunction*/ #ifdefined(MDL_UPDATE) staticvoidmdlUpdate(SimStruct*S,int_Ttid) { } #endif/*MDL_UPDATE*/ #defineMDL_DERIVATIVES/*Changeto#undeftoremovefunction*/ #ifdefined(MDL_DERIVATIVES) staticvoidmdlDerivatives(SimStruct*S) { } #endif/*MDL_DERIVATIVES*/ staticvoidmdlTerminate(SimStruct*S)//这里需要把global变量全部初始化,否则下次运行程序时,全局变量还是之前的值。 { global_var=1; } #ifdefMATLAB_MEX_FILE/*IsthisfilebeingcompiledasaMEX-file?*/ #include"simulink.c"/*MEX-fileinterfacemechanism*/ #else #include"cg_sfun.h"/*Codegenerationregistrationfunction*/ #endif 2.编译 在matlab的commandwindow里面输入“mextest.c”,即可将test.c编译为mex文件。 3.调用sfunction 在simulink空间里面拉入sfunction,在s-function name里面填入test,参数里面填入要设定的参数,然后仿真即可。 参考文献 http://www.baisi.net/viewthread.php?tid=17841
个人分类: 学习笔记|5480 次阅读|0 个评论
UMPU test 甄别样本究竟服从对数正态分布,还是服从幂律分布?
热度 1 zqjiang 2011-5-7 11:36
最近,在拟合一些样本概率分布时候,用对数正态分布对整个样本拟合还不错,但是尾分布用幂律分布拟合也不错。正纠结于选择什么分布比较合适的时候?我发现Sornette教授提出了一个有效的方法 来判断究竟尾分布究竟是对数正态,还是幂律? 想法源于1999年Journal of the American Statistical Association上一篇关于指数和正态分布检验的论文。因为将服从幂律分布或对数正态分布的随机变量取自然对数之后,即转化为服从指数或正态分布的变量。因此,通过对样本参数的简单变换,就可以将目标问题转化为样本变量服从 指数分布, 还是服从 正态分布 的问题 (个人认为很巧妙!)。 如何计算分布参数?如何进行统计检验?具体就不做介绍了,请重点看文献 第三节的第二小节。 Y. Malevergne, V. Pisarenko, D. Sornette, Physical Review E 83 , 036111 (2011). J. D. Castillo, P. Puig, Journal of the American Statistical Association 94 529-532 (1999).
12472 次阅读|0 个评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-20 04:26

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部