Adding New Menu in SImulink

Is it possible to add new menu (like File, Edit) in Simulink

답변 (2개)

Nick
Nick 2016년 4월 18일

1 개 추천

Although this is an old question, I would like to point to this blog item, in which is explained how to organize your customizations in Simulink and/or Stateflow in a structured way.
Babak
Babak 2012년 10월 9일

0 개 추천

Yes it is possible.
Look up sl_customization(cm) on MATLAB's documentation.
You need to write a function whose name must be sl_customization(cm) and put it on MATLAB's path. then issue savepath in command window so that it will remain on the path if you restart MATLAB.
In the sl_customization(cm) function you can add new items to Simulink's menue items and tell Simulink what it should do when each of the custom menu items are clicked.
Generally it is in the customizing the Simulink environment in the Simulink documentation help.

댓글 수: 2

Sunu
Sunu 2012년 10월 9일
편집: Sunu 2012년 10월 9일
I want to add a new menu like (say Actions) and not add to existing menu item.
Babak
Babak 2012년 10월 9일
This is still what does it for you:
function sl_customization(cm)
cm.addCustomMenuFcn('Simulink:MenuBar', @getYOURMENUitems);
end
function schemaFcns = getYOURMENUitems(callbackInfo)
schemaFcns = {@getYOURMENU_container};
end
function schema = getYOURMENU_container(callbackInfo)
schema = sl_container_schema;
schema.tag = 'Simulink:yourname1';
schema.label = 'yournameeee1';
%schema.userdata = '';
% schema.childrenFcns={@getItem0, 'separator', @getItem_comm_container, 'separator', @getItem1, @getItem2, 'separator', @getItem_status_container, 'separator', @getItem_build_download_container, 'separator', @getItem_task_manager};
schema.childrenFcns={@getItem0};
end
you need to write all the getitems functions...
see the help

댓글을 달려면 로그인하십시오.

제품

태그

질문:

2012년 10월 9일

답변:

2016년 4월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by