How in the world can you remember the syntax of all or most of the builtin functions without refering to help on section everytime you use it...
6 views (last 30 days)
Show older comments
help
3 Comments
Walter Roberson
on 8 Aug 2011
Sorry, no; the functions that are currently "built in" to MATLAB in this release might perhaps have been written as .m functions in previous releases; likewise something implemented as a .m file in this release might become implemented as a built-in in a later release. built-in or not built-in is an efficiency issue for the majority of functions.
There _are_ some operations which are built-in because they involve internal behaviors: for example, although it is theoretically possible to calculate the bit representation needed to convert an integer in to the corresponding double precision number, only internal MATLAB behavior can mark the result as _being_ a double precision number. There is, though, no special naming convention for these fundamentally internal operations, and most people do not pay any attention to the fact that fundamentally internal behavior was involved.
Answers (6)
Oleg Komarov
on 8 Aug 2011
From time to time I forget that to compute the min across rows I have to skip the second argument
min(A,[],2)
In general I am very bad at remembering things and I constantly use the:
- "cancel left bracket > rewrite left bracket > wait for inputs hint"
- or F1.
If I were to be examined on a specific problem and the help facilities were disabled I am afraid I will struggle to pass. I guess the difference, as ImageAnalyst pointed out, is wether you know about a certain topic or not and which path you chose to accomplish the task. The examiner will immediately be able to spot your level of knowledge.
3 Comments
Walter Roberson
on 8 Aug 2011
The function handle doesn't go last in accumarray: it goes fourth! The fillvalue and sparse flag go after it.
Sean de Wolski
on 8 Aug 2011
True Walter! I think I used those once only (before I knew how to use histc to keep the subs below their ACTUAL value).
Image Analyst
on 8 Aug 2011
Well the majority of functions I use are the same ones over and over again, so I know what they do and require. But for other functions I often have to refer to documentation. Often I can just type ( (a left parenthesis) and see the popup argument list. But sometimes I just click in the function name and hit F1 and help pops up pretty quickly.
4 Comments
John D'Errico
on 8 Aug 2011
My point is that the syntax of very many functions is quite consistent from function to function. Consistent interfaces are chosen where possible. Default values are chosen as logical ones in context. Complaining won't help you. What will help you is to actually learn the tool you seem to be claiming you know how to use! I think the interviewer caught you on this - that you said you knew how to use matlab, when in fact, you have only the briefest of exposure to it.
Walter Roberson
on 8 Aug 2011
All of the built-in MATLAB functions (excluding MuPad) have the same syntax (unless, that is, some of the toolboxes such as the Parallel Programming one introduce new syntax.)
I suspect you wanted to ask about the semantics of the built-in MATLAB functions. To which I would say that there are too many functions and too many options for anyone to be realistically expected to remember them all.
Experience will lead you to use some functions much more than others; those you will get to know all the major options of.
If you are going for an interview for a particular kind of work, it would be a good idea to review the relevant functions so you can at least talk in general terms even if you do not have all the options memorized. For example if you were going for a job involving animation, I would suggest spending some time reviewing camera and lighting positioning, but if you were going for a job involving (say) wireless communication channels, then I would consider it unfair for the interviewer to lower your mark for not knowing the various lighting models. (Indeed, in my workplace, we would not be permitted to ask questions about areas of knowledge other than the ones described in the job posting.)
Jan
on 8 Aug 2011
Reading the HELP text is not a bad idea. A lot of the built-in commands get more features in new releases. If I had just learned how to use them, I would not have a chance to see them. E.g. FIND and UNIQUE got the 'first' and 'last' after v6.5, ODE45 accepts function handles and anonymous functions, SAVE handles the -struct flag and FOPEN lost is ability to open VAX-D files.
In addition there are a lot of features, which are not written to the docs. They can be found by reading the M-files of the toolbox functions only.
Learning the semantics once and completely is not sufficient to be uptodate with the dynamically growing features of MATLAB. Therefore I suggest to read the HELP, DOC and the release notes again and again.
0 Comments
Fangjun Jiang
on 8 Aug 2011
My answer:
- There are hints available, both in Command Window and M-editor as described by Oleg.
- You can use "Tab" key to search for functions if you vaguely remember the starting letters of the function, both in Command Window and M-editor. For examle, type min and hit Tab key, it will show you a list of functions starting with "min".
- The MATLAB functions could or should be organized following some category, or use the object.method approach, such as Simulink.Bus.save. I think many are on the way, or at least for the new ones.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!