MATLAB - why is it complaining about @ -folders for classdef'd objects?

I have been writing OOP MATLAB code for some time. However, I am now running MATLAB code on a Windows machine for the first time.

I have the following code:

classdef myClass < handle properties i end methods function obj = myClass() obj.i = 0; end function say(obj) obj.i = obj.i + 1; fprintf('This is time #%i you invoked me!\n', obj.i); end end end 

Seems pretty harmless. I try to instantiate an object and I get the following:

 >> m = myClass; Error using myClass Error: File: myClass.m Line: 1 Column: 10 A class definition must be an "@" directory. 

I never used an @ folder all the time when writing OOP MATLAB code. I understand that this is necessary if the class methods are written separately from the classdef file (mine is not) or if it uses the old-style MATLAB class syntax (mine is not).

I think I know what a deal is, and I wanted to see if there is a workaround: My working directory has the form

 C:\Users\ DangKhoa@MyCompany.com \Documents\MATLAB 

Does this mean that @ throws out MATLAB and makes the computer think I'm in the @ -stick? If so, is there a workaround (as opposed to making a new user on my computer, obviously - and it's probably not feasible)? If not, what happens?

+6
source share
1 answer

Looks like yes, @ in the middle of the folder is causing an error. I filed a bug report at The MathWorks.

+4
source

Source: https://habr.com/ru/post/926891/


All Articles