Question: BASH Using only pure BASH (python, bc, awk, etc are NOT allowed!) , write a function called mean that will take one matrix with an

BASH

Using only pure BASH (python, bc, awk, etc are NOT allowed!), write a function called mean that will take one matrix with an unknown number of rows and columns. The function must find the mean of all the numbers in each column and return the mean in a single row. The means will be seperated by tabs.

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 (python, bc, awk, etc are NOT allowed!),

After running our program, we get:

write a function called mean that will take one matrix with an

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!