How do I print a given martix in a spiral matrix scan order but the start from any element as user defined?

4 ビュー (過去 30 日間)
Arshub
Arshub 2022 年 5 月 12 日
編集済み: Arshub 2022 年 5 月 12 日
if i have this matrix : Input:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
I need display it in sipral matrix order as this output:
1 5 9 13 14 15 16 12 8 4 3 2 6 10 11 7
but in this example start from position(1,1) i need to implement code with userdefined start poit like from (2,2) or any point. Then i need make reverse operation to get the original matrix
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

回答 (1 件)

KSSV
KSSV 2022 年 5 月 12 日

カテゴリ

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

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by