create the output folder based on the excel value

1 回表示 (過去 30 日間)
PA
PA 2023 年 6 月 28 日
回答済み: Jacob Mathew 2023 年 6 月 28 日
I Want to create the output folder based on the values of the parameter as there are 4X4 values i need to have 16 output folder.

回答 (1 件)

Jacob Mathew
Jacob Mathew 2023 年 6 月 28 日
Hi PA,
You can create a folder using the mkdir function:
folder_name = "folder";
mkdir(folder_name);
Now all that is needed is to fetch the data from the excel sheet. This can be done using functions like readtable function or you can also use the GUI Import data from Home > Import Data and then opening the Excel Sheet over there.
Once you load the matrix data, convert it from a 4x4 matrix to a 1x16 vector using the reshape method. Then all thats left to be done is to loop over the vector and create a folder with name corresponding to the value at the vector index:
folder_matrix; % this you have imported from the excel sheet as a 4x4 matrix. Make sure its string
folder_vector = reshape(folder_matrix,[1,16]);
for i = 1:numel(folder_vector)
mkdir(folder_vector(i));
end

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by