file name extraction from load file

조회 수: 14 (최근 30일)
Akhtar Rind
Akhtar Rind 2020년 7월 3일
댓글: Akhtar Rind 2020년 7월 4일
I have load data file to extract data and plots.
A typical file name would be '01_02_20_Cu_1.csv' and I use this as
A1= readcell('01_02_20_Cu_1.csv');
How can I get file name "01_02_20_Cu_1" from load data file as text format?

채택된 답변

Kawin Kumaran
Kawin Kumaran 2020년 7월 3일
fileparts() function can be used to extract file name .
file = '01_02_20_Cu_1.csv';
[~,name,~] = fileparts(file)
The result will be :
name : '01_02_20_Cu_1'
Please refer the following documentation for more information .
  댓글 수: 1
Akhtar Rind
Akhtar Rind 2020년 7월 4일
Fantastic. It worked. Many thanks Kawin.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by