Skip to content

Added Transpose Matrix in Every Language Article #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Oct 8, 2020
Merged
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions projects/transpose matrix/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Transpose matrix in Every Language
layout: default
date: 2020-10-03
last-modified: 2020-10-03
featured-image:
tags: [transpose-matrix]
authors: DedAvocado
---

In this article, we'll demonstrate how to find Transpose of a Matrix, its requirements, and how
to test it.

## Description

In linear algebra, the transpose of a matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix A by producing another matrix, often denoted by Aᵀ. The transpose of a matrix was introduced in 1858 by the British mathematician Arthur Cayley.

The solution can be generated using nested loops and exchanging the indexes of the matrix.

## Requirements
Input:

| 1 | 2 | 3 |
| - |:-:| -:|
| 4 | 5 | 6 |
| 7 | 8 | 9 |

The following is the expected output:
| 1 | 4 | 7 |
| - |:-:| -:|
| 2 | 5 | 8 |
| 3 | 6 | 9 |

1. The first matrix is from the given input.
2. The second matrix is the desired output i.e, the transpose of the matrix.

To execute the program :
```transpose.lang 3 3 "1, 2, 3, 4, 5, 6, 7, 8, 9"``` </br>
Here the first two input numbers indicate the size of the matrix and the next input is the list of numbers to be included in the matrix.

## Testing

Verify that the actual output matches the expected output (see [requirements][1])

| Description | size1 | size2 | integers | Output |
| - |:-:|:-:|:-:| -:|
| No input | | | | error |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the error message going to say?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally it should be consistent like "Usage: please enter the dimension of the matrix and the serialized matrix"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha yeah updated it see if it works?

| Missing input: Size | | | ```1, 2, 3, 4, 5, 6``` | error |
| Missing input: integers | 3 | 3 | | error |
| Sample input | 3 | 2 | ```1, 2, 3, 4, 5, 6``` | ```1, 4, 2, 5, 3, 6``` |

## Articles

{% include article_list.md collection=site.categories.transpose-matrix %}

[1]: #requirements