title from indexed variables

Hello, probably this is an easy answer, but I was wondering how I can call directly the 'variable' name as the title of a plot ?. Just the exact characters, for example the one showed in the red circle, it normally changes according to the .mat file. Thanks.

4 件のコメント

Jonas
Jonas 2021 年 4 月 20 日
編集済み: Jonas 2021 年 4 月 20 日
if the name is at the same position for every of your mat file you can call the struct field names using names=fieldnames(.) which gives you a cell array with the names. then you could call e.g. title(names{8})
Fercho_Sala
Fercho_Sala 2021 年 4 月 20 日
編集済み: Fercho_Sala 2021 年 4 月 20 日
@Jonas never is at the same position.
the cyclist
the cyclist 2021 年 4 月 20 日
Suppose for first .mat file, the field names are Height, Error, vrad.
Suppose for the second .mat file, the field names are Error, vrad, Height, specWidth.
How do you decide which field you want to be part of the title?
Fercho_Sala
Fercho_Sala 2021 年 4 月 21 日
it will be something like where exacytly the field name is located?. However the answer privide by @Jonas is a good choise if we already know the numer of that 'location' , thank you so much guys.!

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

回答 (0 件)

カテゴリ

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

製品

リリース

R2020b

質問済み:

2021 年 4 月 20 日

コメント済み:

2021 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by