필터 지우기
필터 지우기

How to organize a project?

조회 수: 8 (최근 30일)
Roy Goodman
Roy Goodman 2020년 8월 31일
편집: Mario Malic 2020년 9월 1일
This is more a general software engineering question than a MATLAB question, but it's about a MATLAB project, so here seems the best place for me to ask.
I have some MATLAB software that I've been working on for a while. The code consists of several parts, and I'd like to set it up as a MATLAB Project (in the formal sense that comes from creating a .prj file). My question is about how to organize the various pieces of code making up the project as I get set up to post it to GitHub, invite a collaborator, and make it available for download among a small community of researchers who would find it useful.
There are three main parts to the code
  • A class definition with lots of methods. This is stored in a directory beginning with an '@' and all the methods are in separate m-files in that directory.
  • Applications of the class definition. Some of these are basically demos and some are examples where I've used this code in published papers.
  • Support codes for dealing with managing the output of computation. These are things that I wrote for my own use over the years and which I naturally used when I was writing the applications. These would ideally be placed in the user's path at startup.
Putting this all into a Project requires them to all be in one directory, which is not how I would do it were it up to me.
  댓글 수: 2
Rik
Rik 2020년 8월 31일
If you want to share it as a Github repository you will have to put it in a single folder as well. What exactly would be your ideal setup?
(note that I don't have a lot of experience with project files. I tend to have a single folder per project, with another folder on my path with the functions I have published to the FEX)
Roy Goodman
Roy Goodman 2020년 9월 1일
I really like the dependency analysis tools that are part of the project infrastructure.

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

채택된 답변

Mario Malic
Mario Malic 2020년 8월 31일
편집: Mario Malic 2020년 9월 1일
Do you want to put project parts in \projectpath\folder1\filesforpart1.m, \projectpath\folder2\filesforpart2.m or would you like to have something like \projectpath\part1\files.m and \otherpath\part2\files.m?
If you thought of the first suggestion then you are able to add these folders to project path and you can commit them to GitHub.
If you thought of the second one, then maybe "Submodules" option could be what you're looking for, but this involves multiple repositories.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by