Info

この質問は閉じられています。 編集または回答するには再度開いてください。

question about the way data is imported

1 回表示 (過去 30 日間)
Emily Bell
Emily Bell 2015 年 11 月 19 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by