フィルターのクリア

class property referred in a legend

1 回表示 (過去 30 日間)
Aga
Aga 2014 年 2 月 13 日
コメント済み: Aga 2014 年 2 月 18 日
Dear all, I am new in Matlab. I wanted to plot recalculated data from multiple files. It worked fine with a loop. I also created a class with aproppiate file properties so I could choose what I want to plot. Now I got stacked with a legend. I wanted to paste there reference to a class property, I thought that would automatise my work .Did not work. I would appreciate any hints. Eg. I have defined: dataset.time, dataset.voltage; instead of typing it myself I wanted to have in a loop legend(dataset.time dataset.voltage) what occured to be wrong. thanks in advance!
  2 件のコメント
Rizwana
Rizwana 2014 年 2 月 14 日
legend 'dataset.time dataset.voltage'
Aga
Aga 2014 年 2 月 18 日
thanks a lot! It might be that I am doing something wrong, but either I typed the way yor wrote it - then the text between '' is treated as string and placed on a legend without reference to true value, or if I omit quotation mark it is just the first one that is taken. What works is :
plot(a,'-r', 'DisplayName', [dataset.voltage,'',dataset.time]);
legend('-DynamicLegend');
that works but after that I am not any more able to refer to column in an easy way as
legend 'dataset.time'.
(Error: "legend" was previously used as a variable,conflicting with its use here as the name of a function
so however it works fine now I am still confused, since I do not understand what has happened Any hints are more than welcome..

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by