Why am I not getting the full output from my for loop?

2 ビュー (過去 30 日間)
Robert  Flores
Robert Flores 2019 年 9 月 9 日
Hello,
I was wondering if anyone can let me know on why I am not getting all my outputs from my for loop. I am expecting to get a 1x32 cell, but am only recieving a 1x19 cell right now; for both my s and x assignments. What I want the for loop to do is make an assignment x, which is made up of structs from the S1 field, such that the first column is my time values and the second column is my acceleration values. Each S1{1,12}.accel_data and S1{1,19}.accel_data has a size of 500001x16 in their repective arrays. This is why I expect to have the for loop output a cell of 1x32.
I thought the way I ordered the two for loops would give me this result, however I was unsuccessful. If anyone can please help me resolve this issue. It will be greatly appreciated.
Sincerely,
Robert Flores
CODE:
clc, clear, close all
zpcstartup
%% Data of Interest
for i = [12:19,31,34,41:93]
filename1{i} = sprintf('Z:\\BARB\\TestData\\ShockData_July2018\\Time_Histories_R2\\test0%d_filt_time.mat',i);
filename2{i} = sprintf('Z:\\BARB\\TestData\\ShockData_July2018\\Time_Histories_R2\\test0%d_raw_time.mat',i);
S1{i} = load(filename1{i});
S2{i} = load(filename2{i});
end
% Note, for extracting Data from these structs, one must use S1{1,i}, the i
% relates to which test one wants to look at. S1 is the 'filtered' data
% and S2 is the 'raw' data.
%% Y-axis Comparison btwn BARC & Bridge [Tests 12,19] (Filtered)
for i = [12 19]
for k = 1:16
x{k} = [S1{1,i}.t_data*1e3,S1{1,i}.accel_data(:,k)];
s{k} = gsrs(x{1,k});
end
end
% Note, I multiplied the t_data by 1000, because the data's time is
% measured in miliseconds.

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by