Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

How I can extract certain range of value from workspace?

2 visualizzazioni (ultimi 30 giorni)
Wen Shu Wong
Wen Shu Wong il 4 Nov 2020
Chiuso: MATLAB Answer Bot il 20 Ago 2021
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?

Risposte (1)

S. Walter
S. Walter il 4 Nov 2020
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 Commento
Wen Shu Wong
Wen Shu Wong il 4 Nov 2020
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?

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by