The ability to draw a straight-line default transition using the external Stateflow API is not available in Stateflow.
To work around this issue, you can use the internal Stateflow API. Be aware, however, that using the internal Stateflow API is not supported, and the syntax can change in a future release of Stateflow.
Here is an example of how you can create a vertical straight-line default transition to a junction in Stateflow:
sfnew
rt = sfroot;
m = rt.find('-isa','Stateflow.Machine');
chart = m.findDeep('Chart');
junct = Stateflow.Junction(chart);
junct.Position.Center = [100 100];
dt = Stateflow.Transition(chart);
dt.Destination = junct;
dt.DrawStyle = 'SMART';
dt.SourceEndPoint = [100 100 - (junct.Position.Radius + 30)];
dt.DestinationOClock = 0;
sf('set',dt.id,'transition.src.intersection.direction',[0 0])
Best Answer