フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I have a A ,15*15 matrice with random numbers , i wanna just get the values outside A (5:8 ,5:8) ,I mean A-A(5:8,5:8)?? i know subtract is not possible , becuase dimension is not same , how can i do this?

1 回表示 (過去 30 日間)
Akshit
Akshit 2015 年 3 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have a A ,15*15 matrice with random numbers , i wanna just get the values outside A (5:8 ,5:8) ,I mean A-A(5:8,5:8)?? i know subtract is not possible , becuase dimension is not same , how can i do this?

回答 (1 件)

Image Analyst
Image Analyst 2015 年 3 月 10 日
Try this:
A = randi(9, [15,15]); % Initial data
% Set middle rectangle to nans
A(5:8,5:8) = nan
% Extract numbers not in the NAN rectangle
output = A(~isnan(A))

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by