自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 资源 (1)
  • 收藏
  • 关注

转载 转一篇关于矩阵的文章:《理解矩阵》

http://blog.csdn.net/myan/article/details/647511

2011-09-29 23:36:20 536

原创 matlab写入和读取txt文件

<br />1.读txt文件<br />如果纯数字文件,可以直接用Load命令<br />如果是数字和字符串混合文件(如excel表格中[姓名;成绩]格式)可以用textread 或者 textscan命令搞定,textread甚至还能对读入的域定义名称,如:<br />[A,B,C,...] = textread('filename','format')<br /> <br />2.写入txt文件<br />使用fprintf<br /> <br />注意:在写入文件之前要先fopen一个文件,注意要设置

2011-05-04 13:44:00 9100

原创 bat批处理

<br />如何制作Bat批处理文件:<br />http://windows.chinaitlab.com/skill/523856.html<br />for 循环命令,只要条件符合,它将多次执行同一命令。  <br /><br />格式FOR [%%f] in (集合) DO [命令]  <br />只要参数f在指定的集合内,则条件成立,执行命令  <br /><br />如果一条批处理文件中有一行:  <br />for %%c in (*.bat *.txt) do type %%c  <br /

2011-04-26 13:27:00 1653

原创 在matlab中调用mex文件

<br />可以将matlab运行缓慢的程序用c语言实现,再在matlab中调用该部分程序:<br />需要:<br />1.包含mex头文件;<br />2.函数原型统一。<br />http://hi.baidu.com/dudasunny/blog/item/bef4793131880b19eac4af71.html

2011-04-25 16:24:00 1210

原创 使用std::sort对struct object排序

<br />需要重载运算符'<',如下面的程序:<br /> <br />typedef struct { float w; int a, b;} edge;bool operator<(const edge &a, const edge &b) { return a.w < b.w;}<br /> <br />以后可以调用std::sort根据dge结构体w的值对进行排序,如:<br /> <br />std::sort(edges, edges + num_edges)

2011-04-15 10:14:00 2121

原创 关于variables declaration 和definition 的一篇文章

<br />http://ee.hawaii.edu/~tep/EE160/Book/chap14/subsection2.1.1.4.html

2011-04-11 16:41:00 487

原创 Essential C++笔记(面向对象编程风格)

1.面向对象编程的几个特点:In an object-oriented program, we indirectly manipulate the class objects of our applicationthrough a pointer or reference of an abstract base class rather than directly manipulate the actualderived class objects of our application. This allo

2011-04-11 11:22:00 496

转载 Matlab与c++混合编程[一.几篇文章]

VC调用MATLAB函数<br />http://blog.csdn.net/csmqq/archive/2010/08/20/5827534.aspx<br /> VC调用matlab中定义的.m文件中的函数的实例<br />http://www.cnitblog.com/edaiqingwa/archive/2006/12/18/20741.html

2011-04-07 15:08:00 475

原创 Matlab与c++混合编程[四.通过VC调用Matlab编译产生的dll文件]

<br />[VS2008 C++ 调用MATLAB 2009b 生成的DLL ]:<br /><br />http://blog.csdn.net/infocarrier/archive/2010/09/01/5854522.aspx<br /> <br /> <br />注意:由于matlab中所有数据类型都是mwarray,所以在运算时,涉及到mwarray和vc数组的转化:首先转换成mwarray调用myadd2函数进行计算,计算完成后还需要再转换成vc数组予以保存。<br /> <br />特别强

2011-04-01 15:08:00 812

原创 Matlab与c++混合编程[三.生成可以独立运行的Matlab程序]

<br />将m文件编译成exe文件,可以直接执行,如下例: <br />function pplotx=0:0.01:2*pi;y=sin(x);plot(x,y);title('curve of sin function');xlabel('x');ylabel('y');end<br />将该m文件保存,然后调用命令mcc -B sgl pplot.m就可以生成一系列文件,其中有一个文件为pplot.exe,双击打开后将会得到正弦曲线。<br /> <br />不过这种方法

2011-04-01 13:52:00 795

原创 Essential C++笔记(基于对象的编程风格)

关于数组When an array is passed into or returned from a function, only the address of the first element is passed.Even though we are accessing the array through a pointer, we can still apply the subscript operator exactly as we did before:template elemType* fi

2011-02-28 17:28:00 821

原创 c++中的局部静态变量(Local Static Object)

<br />局部静态变量和全局静态变量都存储在静态内存中,所以函数退出后局部静态变量不会被释放;不同于全局静态变量的是,它不是file scope visible的,也就是说在file scope 范围内是不能访问的,只能是再次调用该函数时该变量可见。<br /> <br />下面是转载的一段测试代码,来源于http://www.javaeye.com/topic/40705:<br /> <br />#include"stdafx.h"#include <stdio.h>int* f1(int i

2011-02-27 19:03:00 1690

转载 c++的vector赋值方法汇总

<br />#include <iostream>#include <vector>using namespace std;void main(){ vector<int>ivec1(10,42); //内置方法,初始化的内容为10个42 vector<int>ivec2(10); vector<int>::size_type ix=0; for(ix;ix<10;++ix) { ivec2[i

2011-02-26 16:09:00 81958

原创 c++ 和 Matlab 中 for 循环对比

一、在c++中,软件版本visual studio 2008<br />使用下面的代码输出arrayint数组中的元素<br /> int arrayint[5] = {2,4,6,8,10}; for (int j=0;j<5;j++) { j++; cout<<"j: "<<j<<" "<<arrayint[j]<<endl; } cout<<j<<endl;<br />程序输出的结果为:<br />j: 1 4<br />j: 3 8<br

2011-02-26 15:59:00 2960

Matrix Indexing in MATLAB(MatLab中的索引操作)

本文描述了在matlab中对矩阵元素进行索引的几种方法,并通过例子给出了各种用法的灵活使用。

2011-04-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除