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

更多回答(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