- Create an ‘mlapp’
- Use the axes component to draw static elements of the flowchart that do not change, like pipes or fixed structures. You can use functions like plot, line, or rectangle to draw these elements.
- Define a way to represent equipment, such as using images, shapes, or custom drawings. You can use ‘imagesc’, rectangle, or other plotting functions to add these to the axes.
- Add buttons or other controls that let users add or remove equipment. When a user interacts with these controls, the corresponding callback functions will update the flowchart. For adding equipment, you might open a dialog to select the type of equipment and then draw it on the axes. For removing equipment, you might let users select an item on the flowchart and then press a button to delete it.
How to make a flowchart of an industrial plant in app designer, where you can add or remove equipment.
5 views (last 30 days)
Show older comments
How to make a flowchart of an industrial plant in app designer, where you can add or remove equipment.
0 Comments
Answers (1)
prabhat kumar sharma
on 22 Jan 2024
Edited: prabhat kumar sharma
on 22 Jan 2024
Hi Jhoni,
I understand that you want to know how to create a flow chart in the app designer, but app designer is not the correct tool for creating the flow charts, while it does not have any such functionality but I have seen state flow getting used for the flow chart creation.
Here is the link you can refer to know more how to create flow charts in state flow: https://mathworks.com/help/stateflow/ug/flow-charts-in-stateflow.html
If you are looking for an app design to achieve flow chart so there could be a workaround possible:
% Callback function for 'Add Equipment' button
function AddEquipmentButtonPushed(app, event)
equipmentType = 'Pump'; % This could be determined through a dialog
x = 10; % X position where the new equipment should be added
y = 20; % Y position where the new equipment should be added
drawEquipment(app, equipmentType, x, y);
end
% Function to draw equipment on the axes (Added a public function)
function drawEquipment(app, equipmentType, x, y)
switch equipmentType
case 'Pump'
% Draw a rectangle or an image representing a pump
rectangle(app.UIAxes, 'Position', [x, y, 10, 10], 'Curvature', [1, 1], 'FaceColor', 'r');
% Add cases for other types of equipment
end
end
% Callback function for 'Remove Equipment' button
function RemoveEquipmentButtonPushed(app, event)
% Implement logic to remove selected equipment from the axes
% This could involve setting up a way to select equipment on click and then deleting the selected object
end
I hope it helps!
0 Comments
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!