CELL ARRAY AND FOR LOOP

1 vue (au cours des 30 derniers jours)
DINI
DINI le 30 Mai 2019
Commenté : DINI le 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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by