comparing the contents of two folders in different paths in Matlab

Anonymous
timer Asked: Mar 19th, 2016

Question description

GOAL

I am trying to refactor and existing Matlab Model that generates a tgz file that contains a .mat, .m, .txt and .ddf file.

I have the original Model called MATESOld, I have a created a new model called MATESNew where I will do the refactoring and compare with MATESOld to ensure that the functionalities are the same..

APPROACH FOR IMPLEMENTATION

The first step is to design a test, that will compare the files of the tgz generated by MATESOld and MATESNew.

To implement the design of a function to compare two tgz files generated by execution of MATES, the following steps are considered

·  Add the path of the original MATES (MATESOld)

·  Execute the test to generate reference tgz file

·  Remove the added path

·  Add the path of the MATES to be refactored (MATESNew)

·  Execute the test to generate test tgz file

·  Compare the tgz files generated in the path of both MATESOld and MATESNew

o  If files are the same, do not give any message

o  If files are different, give a message with the lines that are different in the in the files in both tgz files

·  Display or report comparison results

PROBLEM ENCOUNTERED

I have a system that generate two tgz files and store one in a folder MATESOld and MATESNew respectively. I want to compare the contents of the two tgz files.

They have a file which takes the path of MATESOld and MATESNew respectively. When compared, it shows that this file in both tgz files are different because of MATESNew and MATESOld in the two paths.

I wish to compare files in the tgz such that the file that takes the paths of MATESOld and MATESNew should take a common path for MATESOld and MATESNew and when the files are compared. it should show that the files are the same.

PROPOSED SOLUTION

To create a new path where the tgz files generated from the paths MATESOld and MATESNew, should be sent to a new path, MATESpath.

The files are the compared from the path of MATESpath.

I don't know if this will work. I have attached here a code I started writing for this assignment. You will have to modify the file compare2MATES which is found in the path

MATLAB\MATESOld\Autotesters\ColumnsOfStructs\compare2MATES

TASK

·  Solve the problem encountered

·  Write xUnit Matlab test for the test function above


Tutor Answer

(Top Tutor) Studypool Tutor
School: University of Virginia
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors