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

1 visualización (últimos 30 días)
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)

Respuestas (1)

Meet
Meet el 8 de Mzo. de 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.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by