Filter löschen
Filter löschen

What is the meaning of following code?

2 Ansichten (letzte 30 Tage)
Prb
Prb am 18 Jun. 2019
Beantwortet: Walter Roberson am 18 Jun. 2019
Hi I would lioke to know the meaning of the following code
NewRes(:,:,Channel,:) = Residuals([1:2:size(Residuals,1)],[1:2:size(Residuals,1)],Channel,:);
what is the syntax here is suggesting. I would like to repesent this in Python.
Thanks

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 18 Jun. 2019
size(Residuals,1) is the number of rows in the Residuals array. 1:2:size(Residuals,1) is the odd-numbered rows. [1:2:size(Residuals,1)] in context is redundant and could be just 1:2:size(Residuals,1) .
So the odd-number rows are selected from Residuals, and the same numbering is used for the columns as well . That is a little risky unless Residuals is known to be the same number of rows and columns.
Channel is kept constant, a scalar, and used to index the third dimension.
All of the 4th dimension is selected.
So Newres in the third pane selected by Channel becomes the odd-numbered rows and columns of Residuals from the third pane selected by Channel.

Weitere Antworten (0)

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by