Dataflow in App Designer

1 view (last 30 days)
fburton on 17 Nov 2020
Commented: J. Alex Lee on 20 Nov 2020
What is a good way to implement a dataflow paradigm in App Designer?
My app consists of processing stages, each of which take input data and generate output data based on settings specified by GUI components. Each stage depends on other stages in a chain or tree (directed graph) being executed to provide its input data. The first stage is typically reading a file and the final stages typically display plots, images or tables of results. Because some stages take a significant time to execute, it makes sense whenever possible not to recompute intermediate results data. However, I need to find a clean way to code this behaviour.
Any suggestions welcome!
J. Alex Lee
J. Alex Lee on 20 Nov 2020
i completely agree about separating calculation from plotting!

Sign in to comment.

Answers (1)

J. Alex Lee
J. Alex Lee on 20 Nov 2020
Yes, much clearer explanation of your question.
All due respect to Sourabh, I do not think you are looking for multi-window app with data passing.
First let's assume that you have the modular functions required on your back end squared away and available to do all the atomic steps of your workflow. [If you don't have that, focus on that first, do not even think about app-izing it].
If you can break your steps that cleanly, then conceptually why not have a "execute" button for each step? On file load, you can have the program go through all the steps, but then say if you want to change a parameter in step C, change it and press the "execute step C" button. Then you can have a "plot results" button, or executing step C can trigger execution of the plot. You can make the user experience a bit more seemless by associating each of your parameters with a step (A,B,C), and automatically executing the relevant step on ValueChanged. This would be easiest if your workflow is truly serial, so that changes in A trigger B, trigger C. If you have a more complicated workflow, like you may be able to change A, but actually wouldn't need to re-run B and can skip to D, but that DOES require triggering F, etc., then I guess you need to think about any kidn of automatic triggers more, or stick with manual step execution buttons or something like that.
To your specific question about the app "knowing" what step has changed, that just sounds like a logical variable to switch on or off depending on if a step has been executed or needs to be executed based on detecting a ValueChanged on something.
  1 Comment
J. Alex Lee
J. Alex Lee on 20 Nov 2020
it may help to use "events and listeners" in addition to callbacks

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!