Updating a graph with Timer Function

Hello,
I have several functions which are called in my main window to produce a constantly updating graph of a matrix with the values of a sine function. At the moment, I can display a static color-mapped version of the matrix but cannot get it to move.
The file "main_window" contains the timer object and the user input variables.
"window_timer" is responsible for calling the function "myMat_new" for creating new images (updating)
"window" is responsible for making the actual figure.
I suspect the issue is in "myMat_new" but I can't figure out what it is.

回答 (1 件)

Geoff Hayes
Geoff Hayes 2017 年 10 月 6 日

0 投票

imaging_tech - your code for myMat_new is
function [ myMat ] = myMat_new( myMat )
x = -pi:1/8:pi;
myMat = sin(x);
end
So you are passing in myMat whenever this function is being called, but you are not making use of it...only resetting it to sin(-pi:1/8:pi). How do you want to be updating this input?

2 件のコメント

imaging_tech
imaging_tech 2017 年 10 月 9 日
The "window_timer" function calls this new function "myMat" and keeps looping until the conditions have been met. The result is a sort of a moving graph from which displays colored bars representing the values of a sine wave.
Geoff Hayes
Geoff Hayes 2017 年 10 月 11 日
right, but myMat_new always returns the same data and does not make use of the input. So the output of myMat_new is always the same so you won't see a "moving" graph.

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

カテゴリ

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

製品

質問済み:

2017 年 10 月 6 日

コメント済み:

2017 年 10 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by