使用strcat函数

时间:2012-03-28 06:34:49

标签: matlab

我想检查一下

workingDir = C:\Users\~\Temp\workspace_folder;
 for i=1:2
 % do an action which generates folder C:\Users\~\Temp\workspace_folder_1 first iteration
 % and increment for each iteration
 x = strcat(workingDir,'_',i);
end

仅提供

x = C:\ Users \〜\ Temp \ _ workspace_folder_,为什么不打印迭代值? 我希望有

C:\Users\~\Temp\workspace_folder_1
C:\Users\~\Temp\workspace_folder_2

由于

1 个答案:

答案 0 :(得分:2)

您需要使用int2str

将i转换为字符串