Matlab can't find my file .m

조회 수: 51 (최근 30일)
Matiss Mutjanko
Matiss Mutjanko 2021년 10월 4일
편집: Stephen23 2021년 10월 5일
I am trying to do a home work, I have given a code to work on, but MATLAB can't find it's location.
Before you say anything about me posting useless question, yes I have tried to solve this myself using this forum.
At this point i have tried to copy paste the code to create new file, but that won't work as well.
p.s. I am no pro in using MATLAB.
  댓글 수: 1
Stephen23
Stephen23 2021년 10월 4일
편집: Stephen23 2021년 10월 5일
It appears that you installed MATLAB to your user's directory, rather than the default Program Files directory (where most applications install on Windows PCs).
You should install MATLAB in the default directory, or possibly in a MATLAB folder on your main disk, but certainly not in a user directory that you then try to use for saving and manipulating your own files in. Application installation folders are usually protected for security and robustness reasons, so the fact that you are trying to work in an application installation directory is a sign of massive weakness and vulnerability on your PC. MIxing your personal data files and application files is a terrible idea.
By the way, this applies to all applications, not just MATLAB: in general they should be installed to your Program Files folder (or similar) and you should NOT be working in the installation folder (or any folder under it).

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

채택된 답변

Monika Jaskolka
Monika Jaskolka 2021년 10월 4일
It looks like the filename of sampling_theory has an extra space at the end. Try renaming the file from "sampling_theory .m" to "sampling_theory.m".
  댓글 수: 1
Steven Lord
Steven Lord 2021년 10월 4일
I agree with your assessment. I'm guessing hovering over that red line on the right side of the Editor window, immediately below the red square, would indicate a Code Analyzer message complaining about that same issue.
When I created a file named "sampling_theory .m" and saved it the Editor showed a dialog warning that I wouldn't be able to run it unless I changed the name. That's another way to detect this type of issue.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by