Greetings for the day.
I am an civil enginnering student and new with the world of programing. I tried to load multiple inputs in program and run with for loop and succesfully achived the result for each input.
clcinputNames = {"mat1.mat", "mat2.mat", "mat3.mat"}length(inputNames)for i = [1:length(inputNames)] load(inputNames{i}) i fprintf("Lx = Length of shorter span = %d mm \n", Lx) fprintf("Ly = Length of longer span = %d mm \n", Ly) endfor
Output:inputNames ={ [1,1] = mat1.mat [1,2] = mat2.mat [1,3] = mat3.mat}ans = 3i = 1Lx = Length of shorter span = 6000 mmLy = Length of longer span = 7000 mmi = 2Lx = Length of shorter span = 7000 mmLy = Length of longer span = 8000 mmi = 3Lx = Length of shorter span = 8000 mmLy = Length of longer span = 9000 mm
Now I want to save the result of each input in different output file.
For example if I run my program with three input files as in above code, i want to store the output in different files i.e, three files.
I really need help to solve this problem.
Best Answer