Live Editor with Matlab Functions in Simulink.

3 次查看(过去 30 天)
Is it possible to use the Live Editor when writing a Matlab Function block in Simulink? It looks like I have to save a live editor .mlx file, then save that file also as a .m file which reformats the live editor benifits, then copy and paste that reduced version into the .slx file for the Simulink block. Am I missing something that would allow me to use the Live Editor on the .slx file directly?

采纳的回答

Walter Roberson
Walter Roberson 2019-2-20
No, it is not possible at this time.
Live Editor does not use simple text files like the main MATLAB editor does: a .mlx file is a zip'd directory containing a number of items including XML files.
MATLAB Function Blocks do not reference .m files. It is not simply a header block together with the name of a .m to invoke, so it is not a simple matter of changing to parsing to permit referencing .mlx files as well.
Instead, MATLAB Function Blocks store the code as one of the properties of the block, inside a XML file, with .slx files turning out to be a zip'd directory containing (mostly) XML files. The Simulink block structure itself would have to be altered to permit Live Editor code.
... This should not be interpreted as "It is not going to happen": this should be understood as "It has not happened as yet, and there are complications that make it tricky to implement, so it might take a while."

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by