Filter löschen
Filter löschen

CELL ARRAY AND FOR LOOP

2 Ansichten (letzte 30 Tage)
DINI
DINI am 30 Mai 2019
Kommentiert: DINI am 31 Mai 2019
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

Akzeptierte Antwort

meghannmarie
meghannmarie am 31 Mai 2019
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 Kommentar
DINI
DINI am 31 Mai 2019
Works perfectly! Thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by