Question: Create a script in your shared directory that reads all the samples in the aluminum.raw, and writes each Stress vs Strain sample out to its
Create a script in your shared directory that reads all the samples in the aluminum.raw, and writes each Stress vs Strain sample out to its own csv file: AL1.csv, AL2.csv, etc. Stress should be in the first column and Strain in the second column of each CSV file.
Please help using Matlab not sure where to start. I cant download the data from matlab but if you could help write the basic script to complete this problem I can apply the data.
I have this so far but not sure if I am on the right path:
f=fopen('aluminum.raw','A');
for i=1:32
fgetl(f);
end
B=fscanf(f,"%f,%f ",[9 Inf]);
fclose(f);
B=transpose(B);
B(1,:);
for i=1:size(B(:,1))
name = sprintf("al%d.csv",i);
fileID = fopen(name,'A');
fprintf(fileID,"%f,%f ",B(i,1),B(i,2));
fclose(fileID);
end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
