フィルターのクリア

How to change a given name

2 ビュー (過去 30 日間)
Dion Theunissen
Dion Theunissen 2021 年 2 月 9 日
コメント済み: Stephen23 2021 年 2 月 9 日
Hi,
An easy question but I can not find the solution. I have a number which is changing but i want to change it by myself.
How can I use that one in my folder name like this:
Thanks in advance
%% test
num = '0000060'
folder = 'C:\Users\dit\Documents\MATLAB\RawData\'+ num +'.csv';

採用された回答

KSSV
KSSV 2021 年 2 月 9 日
編集済み: KSSV 2021 年 2 月 9 日
Also read about strcat.
%% test
num = '0000060'
num = '0000060'
folder = ['C:\Users\dit\Documents\MATLAB\RawData\',num,'.csv']
folder = 'C:\Users\dit\Documents\MATLAB\RawData\0000060.csv'

その他の回答 (1 件)

Jan
Jan 2021 年 2 月 9 日
num = '0000060'
folder = ['C:\Users\dit\Documents\MATLAB\RawData\', num, '.csv'];
% Or with strings instead of char vectors:
folder = "C:\Users\dit\Documents\MATLAB\RawData\" + num + ".csv";
% Or:
num = 60
folder = fullfile('C:\Users\dit\Documents\MATLAB\RawData\', ...
sprintf('%07d.csv', num))
  1 件のコメント
Stephen23
Stephen23 2021 年 2 月 9 日
+1 sprintf is the way to go.

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

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by