How to make an assignment for my for loop?

2 ビュー (過去 30 日間)
Robert  Flores
Robert Flores 2019 年 9 月 13 日
コメント済み: James Tursa 2019 年 9 月 13 日
Hello,
I have some data that I am trying to manipluate to get some other data. For instance I have a time history data, and I am trying to convert it to a set of SRS data. So, SBOB already has a ton of data stored in it. But for some reason it doesn't like it when I try to make the assignment SBOB.x. Can anyone please help me resolve my issue, it will be most appreciated.
Sincerely,
Robert
Error: Unable to perform assignment because dot indexing is not supported for variables of this type.
Error in Drop_Table_DATA_Extraction (line 73)
SBOB.x{p} = [SBOB{1,p}.tt,SBOB{1,p}.Acc(:,r)];
CODE:
for r = 1:16
for p = 1:length(SBOB)
SBOB.x{p} = [SBOB{1,p}.tt,SBOB{1,p}.Acc(:,r)];
SBOB.SRS{p} = gsrs(SBOB.x{p});
end
end
  1 件のコメント
Robert  Flores
Robert Flores 2019 年 9 月 13 日
I have tried indexing the varibles, but that is not working either.
EX:
SBOB.x = zeros(20001,16);
SBOB.SRS = zeros(20001,16);

サインインしてコメントする。

採用された回答

James Tursa
James Tursa 2019 年 9 月 13 日
編集済み: James Tursa 2019 年 9 月 13 日
This syntax with the curly braces next to SBOS means it is a cell array:
SBOB{ whatever }
But this syntax with the dot notation next to SBOB means it is a struct array:
SBOB.whatever
So, which is it? And what are you trying to do? What does this show:
whos SBOB
If SBOS is really a cell array, maybe you need this syntax instead?
SBOB{p}.x = [SBOB{p}.tt,SBOB{p}.Acc(:,r)];
SBOB{p}.SRS = gsrs(SBOB{p}.x);
  2 件のコメント
Robert  Flores
Robert Flores 2019 年 9 月 13 日
編集済み: Robert Flores 2019 年 9 月 13 日
Mr. Tursa,
SBOB has a row of cells, within each of those cells is a struct that contains data like, title of test, accel data, time data, etc. I would try to upload the variables, but they are larger than 2GB.
I want to add to the struct in each cell to include an x and SRS. From there I want, the gsrs function to convert the time history data into a SRS data set, which I would then like to store in the SBOB.SRS.
Please let me know, if this makes sense, if not I can try and explain it more detail.
Best,
Robert
James Tursa
James Tursa 2019 年 9 月 13 日
Did you try my suggestion? (The last two lines of my post)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by