フィルターのクリア

How to transpose a matrix without using built-in functions?

5 ビュー (過去 30 日間)
Anne Nguyen
Anne Nguyen 2019 年 9 月 28 日
回答済み: David Hill 2019 年 9 月 28 日
How do I write a function (called transposeMat) that returns the transpose of a given 3x3 matrix without using any built-in functions (I cannot use transpose(M), rot90(M), or the transpose operator)? The function will receive an input argument x, which is a 3x3 matrix, and will return one output argument y, which is a 3x3 matrix. Below is a possible sample run I was given.
>> transposeMat ([1 2 3; 1 2 1; 3 5 1])
ans = 1 1 3
2 2 5
3 1 1

採用された回答

David Hill
David Hill 2019 年 9 月 28 日
B=[A(1:3);A(4:6);A(7:9)];

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by