Hello,
I need to visualize a watertank in Matlab. I have the height of the water in a 1x1000 array and it needs to change over the time of 1:1000.
Also I need a steady yline that doesn't change.
Is there a build in funktion? can I use the addpoints funktion?

5 件のコメント

madhan ravi
madhan ravi 2020 年 7 月 14 日
You say dynamic and steady , what is your actual target?
KSSV
KSSV 2020 年 7 月 14 日
There is not builtin function.....you need to provide points and plot it...read about plot, set.
Martin Tambour
Martin Tambour 2020 年 7 月 14 日
I need to do this. The blue area should move up or down and is linked to the values of a 1x1000 array
madhan ravi
madhan ravi 2020 年 7 月 14 日
Have you looked into AppDesigner?
Martin Tambour
Martin Tambour 2020 年 7 月 14 日
not yet, thank you!

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

 採用された回答

Steven Lord
Steven Lord 2020 年 7 月 14 日

2 投票

You want something like this?
% Sample data
x = 0:360;
y = sind(x);
% Create the sine curve with one marker
h = plot(x, y, 'Marker', 'o', 'MarkerIndices', 1);
% Create the horizontal line
L = yline(y(1));
for whichPoint = 2:length(y)
% Change the height of the horizontal line
L.Value = y(whichPoint);
% Change which point in the sine curve has the marker
h.MarkerIndices = whichPoint;
% Give MATLAB a chance to redraw the screen
drawnow expose
end

1 件のコメント

Martin Tambour
Martin Tambour 2020 年 7 月 15 日
Thats verry helpful!!
Is it possible to color the area under the horizontal line?

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by