필터 지우기
필터 지우기

Open File From A Full File Path & Extension

조회 수: 79 (최근 30일)
Mohammad Maliq
Mohammad Maliq 2019년 5월 12일
답변: Mohammad Maliq 2019년 5월 12일
Hello all
I have to be honest, what seems to be a very simple task is proving to be a huge nightmare to preform in Matlab.
I want to open a file from its full file path - but really struggling.
I have a variable that contains the full file path of a file that i want to open:-
T = C:\Users\mal\Documents\Matlab\Profile.csv
I simply want to open it - how can i achieve this?
The file is not always a .csv it can be xls or txt etc i simply want to open it and let windows decide which program to open it in.
Cany ideas?
Thank you.

채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 12일
T = 'C:\Users\mal\Documents\Matlab\Profile.csv';
winopen(T)
Note that this is specifically "let windows decide which program to open it in", not "let MATLAB decide which program or function to open it in". So for example for the CSV file, Windows would typically start up Excel and open the file in that, in a program disconnected from MATLAB, whereas MATLAB would typically use importdata() in order to read the file.
If you want MATLAB to decide how to open the file, then use open(T) instead of winopen(T)

추가 답변 (1개)

Mohammad Maliq
Mohammad Maliq 2019년 5월 12일
Walter
Thank you for coming to the rescue again.
:)

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by