Change file matlab workspace name as the folder name

2 ビュー (過去 30 日間)
EMILIO BASTA
EMILIO BASTA 2021 年 2 月 27 日
コメント済み: EMILIO BASTA 2021 年 2 月 27 日
I would like to ask how to change the variable.mat name in my workspace adding the folder name.
For example: in my workspace I have 'POWER.mat' , and the folder name is 'Results2021'
I would like to rename 'POWER.mat' in 'POWER_Results2021'
Thanks for the attention, I am a beginner with Matlab.

採用された回答

dpb
dpb 2021 年 2 月 27 日
" 'POWER.mat' , and the folder name is 'Results2021'"
Well, it depends on whether you have already created the .mat file by having used SAVE or whether you're just referring to the variable POWER shown in the workspace above. For the latter
folder='POWER_Results2021'; % in variable to change or use cd to retrieve current
save(['POWER_' folder],'POWER')
  1 件のコメント
EMILIO BASTA
EMILIO BASTA 2021 年 2 月 27 日
Hi dpb thanks for the answer!
Sorry maybe I explained myseld in a bad way.
Let's say that folder name is 'Results2021'
And the variable in my workspace is 'POWER'
how do I save it as 'POWER_Results2021' ?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by