这是本人第一篇博客,之前写代码的过程中,从网站上也得到了很多帮助,便想着通过自己的项目也能帮助到其他人。正如标题所说,这篇文章的代码是关于使用成员函数读取TXT文档中的数据,并将成员函数的数据以矩阵的形式返回,项目的要求是从一个TXT文档中读取数据,并将读取的数据存到矩阵中用于主函数的计算。
在这里插入代码片
```#pragma once
#include "targetver.h"
#include <iostream>
#include "../eigen3/Eigen/Dense"
#include <fstream>
#include <string>
#include "nilibddc.h" //这是项目另外的要求读tdms文档添加的头文件
using namespace Eigen;//矩阵的运算库
这是头文件stdafx.h中的代码
关于Eigen库的使用可参考这篇文章:https://blog.csdn.net/wzaltzap/article/details/79501856
主程序
在这里插入代码片
#include "stdafx.h"
#include <tchar.h>
using namespace std;
//
//参数
/
//中间变量
//MatrixXf Data;
Matrix<float,10,5>Data;//定义一个矩阵存储读取的设备参数
///
///
//function
void Read_Data(const char* path);//函数声明
///
int _tmain(int argc, _TCHAR* argv