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

1 次查看(过去 30 天)
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)

回答(1 个)

Meet
Meet 2023-3-8
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.

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by