MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]怎样打开文件 (https://www.labfans.com/bbs/showthread.php?t=2113)

limingaini119 2008-04-07 18:31

[求助]怎样打开文件
 
file=uigetfile('*.*');
open(file);
执行后只能打开work文件夹中的*M文件,怎样能够打开电脑中任意位置的任意类型的文件呢,比如F盘下的Word文件,请各位大虾指教!

watcher 2008-04-07 19:29

使用绝对路径即可

mathjiang 2008-04-07 20:25

matlab open word 文档吗?还没听说过哈。

remnant 2008-04-12 20:57

[filename,filepath,filterindex]=uigetfile('*.*'); % uigetfile会返回三个量
filename=strcat( filepath, filename ); %连起来形成绝对路径下的绝对文件
open( filename );


搞定。


顺便说一句,matlab的open指令除了可以打开自己的文件外,还可以调用
相应的程序正确打开html, url, pdf, doc, ppt等文件。


所有时间均为北京时间。现在的时间是 10:55

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.