フィルターのクリア

how do we get adjacent values of an element in a 2D array matrix

10 ビュー (過去 30 日間)
minion001
minion001 2017 年 9 月 9 日
コメント済み: Image Analyst 2017 年 9 月 11 日
for example, the matrix is A[6 4 9 7 3 1; 4 8 1 9 3 8; 3 8 5 7 3 9; 8 2 4 6 3 7]
my current location is A[4,3]=4 and i want to get the adjacent elements [7;6] how would i write this code,
and also if i was at the location A[1,5]=3 how would i get the adjacent elements of it
thanks

採用された回答

Image Analyst
Image Analyst 2017 年 9 月 9 日
  2 件のコメント
minion001
minion001 2017 年 9 月 10 日
if i want to start at one end, for e.g A[1,1], what code would i have to write to elevate all the way till end of column
Image Analyst
Image Analyst 2017 年 9 月 11 日
[rows, columns] = size(A)
for col = 1 : columns
thisColumn = A(:, col);
% Now do something with thisColumn......
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by