フィルターのクリア

Change arrow direction (placed above different colored bars) according to bars(changing continously).

2 ビュー (過去 30 日間)
Suleman  Zafar
Suleman Zafar 2016 年 10 月 27 日
コメント済み: dpb 2016 年 10 月 27 日
Hi, Can you please help me with how can i change an arrow direction above bar plot which are 7 different colour bars.The arrow should be directed upward when bars height increasing and downward when bars height decreasing continuously.Thanks!
index = [1 2 3 4 5 6 7];
axis([0 8 0 0.8])
y=[powlowblue powgreen powyellow poworange powred powpurple powwhite];
for i1=1:numel(y)
text(index(i1),y(i1),num2str(y(i1)),...
'HorizontalAlignment','center',...
'VerticalAlignment','bottom')
text(i1,0.7,'\uparrow');
text(i1,0.6,'\downarrow');
end
how can i get uparrow and downarrow to change according to bars height changing here.
  3 件のコメント
Suleman  Zafar
Suleman Zafar 2016 年 10 月 27 日
編集済み: Suleman Zafar 2016 年 10 月 27 日
I have (bars) data that is coming continuously from the input (amplifier) and bars height is changing so i have just assigned up and down arrows to all the 7 bars but i do not know how to use them such that arrow direction change with bars height increasing or decreasing.
dpb
dpb 2016 年 10 月 27 日
You mean based on difference of current value vis a vis previous, I gather? If so, you'll have to
  1. save the current value
  2. compare new value to that previous when it arrives
  3. set arrow direction with logic branch (an if...else...end would be likely candidate here), and
  4. save the current as the new previous values

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by