Borrar filtros
Borrar filtros

How can I derive partitions of data sets in for loop

1 visualización (últimos 30 días)
Ioannis
Ioannis el 9 de Oct. de 2013
Respondida: A Jenkins el 9 de Oct. de 2013
Hello I have a bunch of data-sets. Each one has 4 columns.
I load them as follows:
for i=1:20
load(['c',num2str(i)])
end
But then, I want to create a new matrix within a for loop, which will store from each file specific samples from a specific column. What I tried and it failed is the following
for j=1:20
dd(:,j)=(['c',num2str(j),'(410:910,2)'])
end
Any hints on how to get around this?
Kind Regards

Respuesta aceptada

A Jenkins
A Jenkins el 9 de Oct. de 2013
Creating arrays with the number in the name is considered bad programming practice, so instead of fixing your code, most people will recommend you use a different method to store your data. If you MUST do it this way, then you will need to use eval.
But please read the FAQ first.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by