Question: BASH Using only pure BASH , write a function called mean that will take one M x N matrix with an unknown number of rows

BASH

Using only pure BASH, write a function called mean that will take one M x N matrix with an unknown number of rows and columns and return a one row vector where the means are given for each column as integers seperated by tabs (the first element is the mean of column 1, the second element is the mean of column 2, etc).

The input matrix will be integers seperated by tabs:

1\t2\t3

4\t5\t6

7\t8\t9

Given a sample matrix:

BASH Using only pure BASH, write a function called mean that will

After running our program, we get:

take one M x N matrix with an unknown number of rows

The output is seperated by tabs.

The input must be a matrix of unknown size and this script must return the mean of the columns as seen above.

AWK, Python, and other embedded languages are not allowed.

$ cat m1 1 5 2 4 7 $ cat m1 1 5 2 4 7

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!