フィルターのクリア

Different ways of specifying arguments in build-in Matlab commands

2 ビュー (過去 30 日間)
s z
s z 2019 年 1 月 23 日
コメント済み: Walter Roberson 2019 年 2 月 1 日
Hi,
I have got a quick questions, it probably a really stupid one but I just can't grasp my head around it... In Matlab it seems that it is possible to call a build-in matlab command with arguments in two different ways. The first one is just by sepcifiying the arguments in the functions
scatter(x,y,sz,'d')
The second method is by using strings to kind of 'announce' to the function that the necessary arguments are coming
scatter(x,y,sz,'MarkerEdgeColor',[0 .5 .5],...
'MarkerFaceColor',[0 .7 .7],...
'LineWidth',1.5)
Why is it not possible to just do
scatter(x,y,sz,[0 .5 .5],[0 .7 .7],1.5)

採用された回答

Walter Roberson
Walter Roberson 2019 年 1 月 23 日
Because
scatter(x, y, sz, 'LineWidth', 1.5, 'MarkerFaceColor', [0 .7 .7], 'Parent', gca, 'MarkerEdgeColor',[0 .5 .5])
is also valid. Name/Value pairs can occur in any order, and are (often) optional, so scatter would have no way of knowing that
scatter(x,y,sz,[0 .5 .5],[0 .7 .7],1.5)
was not intended to mean
scatter(x, y, sz, 'MarkerFaceColor', [0 0.5 0.5], 'MarkeEdgeColor', [0 0.7 0.7], 'Parent', 1.5)
  5 件のコメント
s z
s z 2019 年 2 月 1 日
Thank you!
Walter Roberson
Walter Roberson 2019 年 2 月 1 日
properties matlab.graphics.chart.primitive.Line
properties matlab.graphics.chart.primitive.Bar
bp = ?matlab.graphics.chart.primitive.Bar;
sortrows(char({bp.PropertyList.Name}))
sortrows(char({bp.PropertyList([bp.PropertyList.Hidden]).Name}))

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by