Using graph theory inside Simulink
Ältere Kommentare anzeigen
Hello, I want to use the graph theory inside Simulink to generate C-Code after (https://fr.mathworks.com/help/bioinfo/ug/graph-theory-functions.html), but I am facing these issues :
Graph variables aren’t handle by data dictionaries, but are inside base and model workspace
There is no Simulink block to use directly graphs
In a Matlab function block, I can load a graph from Model Workspace, as data parameter but Simulink won’t handle it :
- Error : Expression 'myGraph' for initial value of data 'myGraph' must evaluate to logical or supported numeric type.
I used a very simple graph and it has only scalar string types for Variables
- Edge_Table = table(["1" "2"; "2" "3"], 'VariableNames', {'EndNodes'});
- myGraph = graph(Edge_Table);
My conclusion is we can’t use graph theory variables and functions and Simulink, the only way to use it it’s to use Matlab with functions or scripts and inside Matlab create graphs and use functions, then convert results in supported data to Simulink (like doubles) and use simin and simout blocks. But after all that, I am not sure we would be able to generate C-Code.
I would like to know if my conclusion is correct or if there are other ways to use graphs in Simulink. Thank you in advance for your help.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!