Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions

Question

6.7 Discuss strategies for recruiting a more diverse workforce.

Answered: 1 week ago