0

I want to run my codes for different people. I dedicated a number to each person to save the results.

How can I change the filenames by changing one parameter, to avoid changing the filename in several places. The code is here:

patient_num = 2;
ImagesOutputPath = fullfile([MyFilesPath,'\ImagesOutput_P_2']);
save segmented_img_P_2.mat Segmented_img
save volume_P_2.mat volume
save time_P_2.mat tEnd

1 Answer 1

2

Do you need something like this?:

patient_num = 2;
ImagesOutputPath = fullfile([MyFilesPath,'\ImagesOutput_P_', num2str(patient_num)]);
save(['segmented_img_P_',  num2str(patient_num), '.mat'], 'Segmented_img')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.