声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3528|回复: 4

[编程技巧] 求助:uigetfile 打开文件时初始路径设置问题

[复制链接]
发表于 2010-12-17 03:55 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
当用uigetfile函数来打开文件时,谈出对话框的初始路径是matlab的文件夹,然后我的数据在别的地方,切过去很麻烦,如何改变这个初始路径使它更靠近我的目标位置呢?  求教。

先多谢了!!

评分

1

查看全部评分

回复
分享到:

使用道具 举报

发表于 2010-12-17 08:08 | 显示全部楼层
考量先使用cd函数
发表于 2010-12-17 09:06 | 显示全部楼层
本帖最后由 tenglang 于 2010-12-17 09:09 编辑

help  uigetfile, you will find:
uigetfile(FilterSpec,DialogTitle,DefaultName)  displays a dialog box in which the filename specified by DefaultName appears in the File name field. DefaultName can also be a path or a path/filename. In this case, uigetfile opens the dialog box in the directory specified by the path. See Example 6 . Note that you can use '.','..', or '/' in the DefaultName argument.

Example 6This example uses the DefaultName argument to specify a start path and a default filename for the dialog box.


  1. uigetfile({'*.jpg;*.tif;*.png;*.gif','All Image Files';...
  2. '*.*','All Files' },'mytitle',...
  3. 'C:\Work\myfile.jpg'
复制代码



评分

2

查看全部评分

发表于 2010-12-17 09:20 | 显示全部楼层
本帖最后由 zhouyang664 于 2010-12-17 09:20 编辑

MATLAB自己的help这些事情就讲的挺清楚的,楼主不要忘记help啊!
 楼主| 发表于 2010-12-24 07:11 | 显示全部楼层
多谢各位了!!
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-21 16:24 , Processed in 0.056245 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表