Current folder window: how does "MATLAB Code File" differ from "Script"

I'm puzzled by the listing in my current folder window. I hadn't noticed a file type called "MATLAB Code File" before, and I'm trying to figure out how it's different from the "Script" type. Both kinds of file contain legal top-level code split into execution cells.
I haven't found documentation of this - a pointer to relevant documentation would be most helpful.
I'm using R2013b.

댓글 수: 3

Adam
Adam 2014년 11월 13일
편집: Adam 2014년 11월 13일
What is in makeFigures.m?
I would suggest that Matlab simply cannot determine for some reason whether it is a function or a script or class so 'Matlab Code File' is just its default for some unidentified .m file.
Glancing through all my folders of code I can't find a single one that has that type. I just have lots of 'class', 'function' and 'script' types.
I did also attempt to create a file with that designation, but failed. Even a .m file with nothing but a comment in was classified as a script. I am running Matlab R2014b so maybe yours is different?
Thanks Adam. Like you I've never seen a file of this type before.
makeFigures.m contains legal top-level code split into execution cells. That is, it's just a script, like all the files marked script.
Bizarre! I made an edit, reversed it, and saved the file, and the type has changed to "script"! So it looks like it was a kind of temporary identification, made because for some reason the filebrowser hadn't managed to figure out what the type was, as Adam suggested.
This means that the question doesn't really matter any more, as the image above amounts to a mere glitch. I'll leave it here anyway, as a curiosity, and in case anyone has a deeper insight. All the same, Adam - if you make your comment an answer, I'll be happy to accept it.

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

 채택된 답변

Adam
Adam 2014년 11월 13일

0 개 추천

What is in makeFigures.m?
I would suggest that Matlab simply cannot determine for some reason whether it is a function or a script or class so 'Matlab Code File' is just its default for some unidentified .m file.
Glancing through all my folders of code I can't find a single one that has that type. I just have lots of 'class', 'function' and 'script' types.
I did also attempt to create a file with that designation, but failed. Even a .m file with nothing but a comment in was classified as a script. I am running Matlab R2014b so maybe yours is different?

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2014년 11월 13일

답변:

2014년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by