随笔分类 - Matlab
摘要:Q:Suppose I have the following string:s = 'Foo 1.000 3.000 3.554'I would like to read it with the textscan function as follows.[name x y z] = textscan(s, '%s %f %f %f')However, when I do this, I always get the Too many output arguments error.I think it has to do with the fact that te
阅读全文
摘要:在编写一个程序时,经常需要从外部读入数据,或者将程序运行的结果保存为文件。MATLAB使用多种格式打开和保存数据。本章将要介绍 MATLAB中文件的读写和数据的导入导出。13.1 数据基本操作 本节介绍基本的数据操作,包括工作区的保存、导入和文件打开。13.1.1 文件的存储 MATLAB支持工作区的保存。用户可以将工作区或工作区中的变量以文件的形式保存,以备在需要时再次导入。保存工作区可以通过菜单进行,也可以通过命令窗口进行。 1. 保存整个工作区 选择File菜单中的Save Workspace As…命令,或者单击工作区浏览器工具栏中的Save,可以将工作区中的变量保存为MAT文...
阅读全文