join string FileName without spaces

13 ビュー (過去 30 日間)
Nik Rocky
Nik Rocky 2020 年 6 月 24 日
コメント済み: darova 2020 年 6 月 25 日
Hello,
i create my own name from filepath and name:
Measure_Name = strsplit(FilePath, '/');
MotorSet = string(Measure_Name{1,8});
MotorSet = strsplit(MotorSet, '_');
MotorSet = string(MotorSet{1,3});
Microphone = string(Measure_Name{1,9});
Microphone = strsplit(Microphone, '_');
Microphone = string(Microphone{1,1});
Distance = string(Measure_Name{1,10});
Distance = strsplit(Distance, '_');
Distance = string(Distance{1,2});
Szenario = string(Measure_Name{1,11});
Szenario = strsplit(Szenario, '_');
Szenario = string(Szenario{1,2});
SNRname = strsplit(mat_file_name, '_');
SNRname = string(SNRname{1,end-1});
Meas_name = strsplit(mat_file_name, '_');
Meas_name = string(Meas_name{1,1});
sep = '_';
FileSave = [Meas_name sep Szenario sep Distance sep Microphone sep 'F' harm sep 'MS' MotorSet];
and I get:
FileSave =
"001 _ M1 _ 0.5m _ AKG _ F 2 _ MS 1"
I want have
"001_M1_0.5m_AKG_F2_MS1" - how it is possible?
Thank you!

採用された回答

madhan ravi
madhan ravi 2020 年 6 月 24 日
編集済み: madhan ravi 2020 年 6 月 24 日
regexprep(FileSave," ","")
% or
strrep(FileSave," ","")
  2 件のコメント
Nik Rocky
Nik Rocky 2020 年 6 月 24 日
Thank you very much! It works very nice!
darova
darova 2020 年 6 月 25 日

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDenoising and Compression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by