文件名的制表符补全作为MATLAB脚本的参数 [英] Tab-completion of filenames as arguments for MATLAB scripts

查看:142
本文介绍了文件名的制表符补全作为MATLAB脚本的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们都知道MATLAB为MATLAB函数(如importdataimread)中用作参数的文件名提供制表符补全功能.对于创建的功能,我们该怎么做?

We all know MATLAB provides tab-completion for filenames used as arguments in MATLAB function like importdata,imread. How do we do that for the functions we create?

显示当前目录中的文件和文件夹.

Displays the files and folders in the current directory.

推荐答案

警告:此处不支持hack.

Caution: unsupported hack here.

在您的Matlab安装中查看文件toolbox \ local \ TC.xml.它似乎包含用于制表符补全的参数类型映射. (我只是通过在Matlab安装中为R2009b中的"imread"找到它.)

Take a look at the file toolbox\local\TC.xml in your Matlab installation. This appears to contain the argument type mappings for tab completion. (I found this by just grepping the Matlab installation for "imread" in R2009b.)

<TC>元素内添加此行将使您可以为每个参数的制表符完成制表符的输入.

Adding this line inside the <TC> element will get you tab-completion of file names for each of its arguments.

<binding name="importdata"        ctype="FILE"/>

这需要修改Matlab安装.对于工具箱/本地文件中的其他一些文件,例如classpath.txt,您可以通过将修改后的副本放置在启动Matlab的目录中来覆盖它们,但这对TC.xml来说不起作用.

This requires modifying the Matlab installation in place. For some of the other files in toolbox/local, like classpath.txt, you can override them by placing modified copies in the directory you start Matlab from, but this didn't work for TC.xml for me.

这篇关于文件名的制表符补全作为MATLAB脚本的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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