Question: In matlab: Please help me add more onto this code where I can save the data on to an export text file. The data can

In matlab:

Please help me add more onto this code where I can save the data on to an export text file. The data can currently be seen within the command window and it has multiple columns. Thanks.

function[TopX, TopY, BottomX, BottomY] = AssortingDatFile(finalM) % Should analyze the top and bottom arrays of the X & Y coordinates

TopX = [];

TopY = [];

BottomX = [];

BottomY = [];

minX = min(finalM(:,1)); % Find the minimum and maximum values of X & Y

maxX = max(finalM(:,1));

minY = min(finalM(:,2));

maxY = max(finalM(:,2));

for i = 1:length(finalM) % Goes through finalM made from initial function

finalM(i,1) = (finalM(i,1) - minX) / (maxX - minX); % Normalizing X & Y coordinates

finalM(i,2) = (finalM(i,2) - minY) / (maxY - minY);

if finalM (i,2) > 0 % Checks to see if negative

TopX = [TopX, finalM(i,1)]; % Top Array

TopY = [TopY, finalM(i,2)];

else

BottomX = [BottomX, finalM(i,1)]; % Bottom Array

BottomY = [BottomY, finalM(i,2)];

end

end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!