필터 지우기
필터 지우기

CELL ARRAY AND FOR LOOP

조회 수: 2 (최근 30일)
DINI
DINI 2019년 5월 30일
댓글: DINI 2019년 5월 31일
Hello everyone, I'm doing some tests and I need to create and save certain values.
The thing is that I do not know how to introduce the 6th line inside the first loop est = {est_1, est_2, est_3, est_4};
The second problem is that at the end of the second loop, I save the variable input accommodated, but only stored the last iteration, I do not know how to store ALL in a new array of cells input(ind_24,:)= [];
clear all
%cargo todas los puntos grilla
puntos = 4;
for i=1:puntos
load(['est_',num2str(i),'.est']);
end
est = {est_1, est_2, est_3, est_4};
%Filtro valores iniciales, para que la matriz este comprendida envalore del 0 - 23.
for i=1:puntos
input = est{i};
ind_24 = find(input(:,5)==24);
input(ind_24,:)= [];
end

채택된 답변

meghannmarie
meghannmarie 2019년 5월 31일
Try this, if I am understanding your questions right:
%cargo todas los puntos grilla
puntos = 4;
est = cell(puntos);
for i=1:puntos
load(['est_',num2str(i),'.est']);
est{i} = eval(['est_' num2str(i)]);
end
% est = {est_1, est_2, est_3, est_4};
%Filtro valores iniciales, para que la matriz este comprendida envalore del 0 - 23.
inputs = cell(puntos);
for i=1:puntos
input = est{i};
ind_24 = find(input(:,5)==24);
input(ind_24,:)= [];
inputs{i} = input;
end
  댓글 수: 1
DINI
DINI 2019년 5월 31일
Works perfectly! Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by