导入txt文件的名称 [英] Import name of txt file

查看:113
本文介绍了导入txt文件的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我对在程序中导入数据有疑问。我不知道如何在我的程序中导入txt文件的名称(包括数据),并在Matlab中将此文件用作我的函数的参数。实际上,我想,我程序的用户可以输入txt文件的名称;之后我的程序中的一个函数使用此文件作为函数的输入参数。我想要像load这样的东西。

Dear all,
I have question about importing data in my program. I do not know how can import name of txt file(that include data) in my program and use this file as argument of my function in Matlab. In fact, I want, user of my program can input name of txt file; after that one of my function in my program usese this file as input argument of function. I want something like load.

推荐答案

通过控制台或公共对话框从用户那里获取文件的名称。然后你只需要读取文件的内容并根据需要进行处理。
Get the name of the file from the user, either by console or common dialog. Then you just need to read the contents of the file and process it as required.


这样做的最好方法是使用matlab中存在的strcat函数。
The best way for doing this is that we use a strcat function that exists in Matlab.


这篇关于导入txt文件的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆