필터 지우기
필터 지우기

How to obtain a vector of indices using loop

조회 수: 1 (최근 30일)
juan sanchez
juan sanchez 2019년 9월 15일
편집: dpb 2019년 9월 15일
Hi, I have a 10,000 row x 16 column x numFiles pages corresponding to time x heights x horizontal distances representing the measurements of mean speed Vmean speed in a 3D cell array.
If I want to get the maximum value index all I have to do is type: Vmax all=[V_max_all,I] = max(abs(V_mean(:))
where I is the linear index location that correspond to Vmax inside the total Vmean array.
Then in order to extract the subscripts for this Vmax inside the array I use:
[I_time, I_station, I_file] = ind2sub(size(V_mean),I)
On the other hand, I also have Venvelope = (Vmax1;Vmax2;Vmax3;...Vmmax16) where Venv is a 16 row x numfile column,
Therefore, I want to obtain a loop from which I can obtain a vector with the indices for each corresponding height
for i=1:16
for j=1:numfiles
[I_time, I_station, I_file] = ind2sub(size(V_mean(time, i,j)),I)
....
so I could obtain the vector [I_time, I_station, I_file] corresponding to each Vmax1;Vmax2,...)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Stability Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by