Having some error while using doLayout, will appreciate any help. Incorrect number or types of inputs or outputs for function 'doLayout'.

1 view (last 30 days)
Hi I keep having this error while trying to run this code
Incorrect number or types of inputs or outputs for function 'doLayout'.
clc;
clear all;
close all;
format
A=[1 -1 0 0;0 1 0 -1 ; -1 0 1 0 ;0 0 -1 1]; %D
% To Create topology
DG=A;
DG(1,1)=0;
DG(2,2)=0;
DG(3,3)=0;
DG(4,4)=0;
id={'1','2','3','4'};
DG=digraph(DG,id);
plot(DG)
doLayout(DG);
DG.Nodes(1).Position=[54 158];
DG.Nodes(2).Position=[32 110];
DG.Nodes(3).Position=[74 110]
DG.Nodes(4).Position=[54 62];
dolayout(DG,'Pathsonly',true);
view(DG)

Answers (1)

Meet
Meet on 8 Mar 2023
Hi,
The function dolayout has been removed with MATLAB R2022b. This may be the cause of the error that you are getting. Instead, you can use the layout method for changing the layout of graph objects.
Please refer layout documentation for more details.

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!