Menu

[Solved]Function Name Mat2txt Inputs 1 Double Mxn Array Containing Nonnegative Integers 2 Char Fil Q37104999

Function Name: mat2txt Inputs 1. (double) An MxN array containing nonnegative integers 2. (char) A filename ending in .txt FiMATLAB

Function Name: mat2txt Inputs 1. (double) An MxN array containing nonnegative integers 2. (char) A filename ending in .txt File Outputs: 1. A text file containing a table created based on the input double array Background: MATLAB homework is one of them Plain text tables are useful in very few situations. (Un)Fortunately for you, your final Function Description: Create a plain text table based on the input double array. It should look like the one in the example below, where each intersection of lines is represented by a plus sign, ‘+’, each vertical bar is represented by ”, and each horizontal bar is represented with a dash, -‘. The width of each cell should be determined by the longest value (in terms of the number of digits) in the array, and all values should be right aligned in their cells Example: >> array [1613, 1359015, 38; 385915, 953, 1; 58915, 6930, 1390]; >> filenamearray.txt’; >> mat2txt(array, filename); array.txt 1613 1359015 38 1l | 58915| 693 1390 |385915 953 Notes: . Do not include an extra newline character at the end . You will only be given positive integers Show transcribed image text Function Name: mat2txt Inputs 1. (double) An MxN array containing nonnegative integers 2. (char) A filename ending in .txt File Outputs: 1. A text file containing a table created based on the input double array Background: MATLAB homework is one of them Plain text tables are useful in very few situations. (Un)Fortunately for you, your final Function Description: Create a plain text table based on the input double array. It should look like the one in the example below, where each intersection of lines is represented by a plus sign, ‘+’, each vertical bar is represented by ”, and each horizontal bar is represented with a dash, -‘. The width of each cell should be determined by the longest value (in terms of the number of digits) in the array, and all values should be right aligned in their cells Example: >> array [1613, 1359015, 38; 385915, 953, 1; 58915, 6930, 1390]; >> filenamearray.txt’; >> mat2txt(array, filename); array.txt 1613 1359015 38 1l | 58915| 693 1390 |385915 953 Notes: . Do not include an extra newline character at the end . You will only be given positive integers

Expert Answer


Answer to Function Name: mat2txt Inputs 1. (double) An MxN array containing nonnegative integers 2. (char) A filename ending in .t… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *