Don’t forget to push your answers to your remote repository by the end of quiz time. Push all your answers to quiz/4/ folder in your Github project.
Consider this comma-separated data file: data.in. Write a simple script named csv2formatted
that takes two input arguments representing the input and output file names. Then, the script writes the same input float data to the output file data.out
in a formatted style, like this example output file: example output file. Note that every numer in the output file has only three significant digits after the decimal point.
Write your Python script in such a way that it takes the input and output file names from the Bash command line arguments, like the following,
python csv2formatted.py data.in dataPython.out
Write your MATLAB script as a function that takes the input and output file names as input arguments to a function named csv2formatted
, so that it can be called like the following from the MATLAB command line.
csv2formatted('data.in','dataMATLAB.out')