Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

question about the way data is imported

1 visualización (últimos 30 días)
Emily Bell
Emily Bell el 19 de Nov. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I'm trying to import data from 26 separate files into the variables u and v, and I want 26 separate instances each of u and v (ie u_1 through u_26). In the files, u and v are 29x39 doubles. I tried the following code to create u and v as 3D arrays:
if true
for k=1:26
filename = sprintf('Angle1-%d.mat', k);
data = load(filename);
u = zeros(29, 39, 26);
v = zeros(29, 39, 27);
u(:, :, k) = data.u;
v(:, :, k) = data.v;
end
This made sense to me conceptually but it didn't seem to work in practice - the whole array ended up being zeros except for the last set of 29x39. Is there a better way to import this data?

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by