Info

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

How I can extract certain range of value from workspace?

1 回表示 (過去 30 日間)
Wen Shu Wong
Wen Shu Wong 2020 年 11 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have load 100x100 mat file into workspace. How can I extract certain range of values for example (5:10)x(5:10) from the workspace?
  1 件のコメント
João Mendes
João Mendes 2020 年 11 月 4 日
Please clarify what you want

回答 (1 件)

S. Walter
S. Walter 2020 年 11 月 4 日
You have a matrix A:
A = rand(100,100);
You want only the 5th through the 10th elements, you can do that using the colon operator:
B = A(5:10,5:10);
  1 件のコメント
Wen Shu Wong
Wen Shu Wong 2020 年 11 月 4 日
Hello. I've tried to extract it as A(264:271 , 267:274) but the output is not what I expected. May I know what is the problem with this?

Community Treasure Hunt

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

Start Hunting!

Translated by