Choosing a specific data from a structure

Hello,
I'm trying to access a structure data by using this code :
File = fullfile(Path, sprintf('%s.mat',Name));
FileData = load(File, Name2);
Alpha = FileData.Name2.Vectors;
Where Path is the path where the structure is stored; Name is the name of the structure and Name2 is the name of one of the .mat file stored in the structure. All works fine util the loading process.
Now i want to choose a specific data stored in Name2.mat which is "Vectors". The problem is that "Name2" is an input of a function so "FileData.Name2.Vectors" won't works in a function. i want to know is there a way to fix this issue?
thank you for your help

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2017년 11월 15일

댓글:

2017년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by