Filter löschen
Filter löschen

Reference to non-existing field

1 Ansicht (letzte 30 Tage)
Sam
Sam am 18 Mär. 2016
Beantwortet: Adam am 18 Mär. 2016
Hello,
I wrote a code but it gives the error "Reference to non-existing field 'Cycle'". All the fields I want to reference to, are named: Cycle1 Cycle2 Cycle3...
load('RefData.mat')
i = 0;
for i = 1:60
filename = 'Test_script';
xlrange = 'C(1+i):CY(1+i)';
xlswrite(filename,RefData.tasks.HTS.EntireCycle.angles.rawData.Cycle(i).LElbowProSupination,1,xlrange)
end
Any help?
Thanks!

Antworten (1)

Adam
Adam am 18 Mär. 2016
Try this instead:
xlswrite(filename,RefData.tasks.HTS.EntireCycle.angles.rawData.( ['Cycle' num2str(i)] ).LElbowProSupination,1,xlrange)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by