@ folders - what is it?
3 views (last 30 days)
Show older comments
Hi,
I am looking for information about the @ - directories, I've found only: http://www.mathworks.com/help/techdoc/matlab_oop/brfynrp- 1.html#brfynrp-2
So I have question:
Why do you need these folders?
Only for organizing classes?
Or is there any other application?
0 Comments
Accepted Answer
Titus Edelhofer
on 9 Sep 2011
The second question is the answer: yes, it's "only" for organizing classes.
You can either use only one file or several files (each one method) in a class folder (@classname). Or a mixture. Take a look at
web([docroot '/techdoc/matlab_oop/brqy4ox-1.html'])
Titus
2 Comments
Jan
on 9 Sep 2011
@Titus: I do not agree. E.g. @cell folders are helpful to apply a specific function for CELL input. I would not call this "organizing classes", but on the other hand, a CELL is a built-in class also.
More Answers (1)
Jan
on 9 Sep 2011
The @-folders can be used to call a specific function depending on the class of the input. E.g. you can create two functions with the same name, but in different @-folders:
D:\MFiles\@double\show.m
D:\MFiles\@cell\show.m
Now show(8) calls @double/show, while show({8}) calls @cell/show. This is equivalent to the usage with objects.
Note, that only 'D:\MFiles' is included in the MATLAB path in this case, and not the @-folders.
0 Comments
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!