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

 採用された回答

Stephen23
Stephen23 2017 年 11 月 15 日

0 投票

1 件のコメント

RHedfi
RHedfi 2017 年 11 月 15 日
Thank you Stephen

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

質問済み:

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