By Doug Hull
11:28 UTC | Posted in Format: Video, Level: Basic, Topic: GUI or GUIDE | Permalink |
You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.
It is a fine Exampla but the code line: set(hObject, ‘String’, ‘12′); is IMO not realy adecuate.
These kind of declarations will produce “other errors” soon or later… I find better something like:
set(hObject, ‘String’, num2str(modeNum) );
so wenn you mustchange the treshold value you shuoldf change only one value, isn’t it?
Best regards!
J.R.!
José,
I totally agree with your idea here. In my video series “Cleaner Code in MATLAB”
http://blogs.mathworks.com/pick/2006/12/13/cleaner-code-in-matlab-part-1-of-series/ http://blogs.mathworks.com/pick/2007/01/12/cleaner-code-in-matlab-part-two/
I talk about how you should avoid the use of Magic Numbers. Sometimes I do things for brevity in the videos that I could do better with more time.
Thanks! Doug
Video cutting off after 1:30 seconds today- tried three times.
Ken,
Thank you, the file was corrupted. I have verified the fix is working now.
Thanks, Doug
Wrap code fragments inside <pre> tags, like this:
<pre class="code"> a = magic(3); sum(a) </pre>
If you have a "<" character in your code, either follow it with a space or replace it with "<" (including the semicolon).
Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.
These postings are the author's and don't necessarily represent the opinions of The MathWorks.
It is a fine Exampla but the code line:
set(hObject, ‘String’, ‘12′);
is IMO not realy adecuate.
These kind of declarations will produce “other errors” soon or later… I find better something like:
set(hObject, ‘String’, num2str(modeNum) );
so wenn you mustchange the treshold value you shuoldf change only one value, isn’t it?
Best regards!
J.R.!
José,
I totally agree with your idea here. In my video series “Cleaner Code in MATLAB”
http://blogs.mathworks.com/pick/2006/12/13/cleaner-code-in-matlab-part-1-of-series/
http://blogs.mathworks.com/pick/2007/01/12/cleaner-code-in-matlab-part-two/
I talk about how you should avoid the use of Magic Numbers. Sometimes I do things for brevity in the videos that I could do better with more time.
Thanks!
Doug
Video cutting off after 1:30 seconds today- tried three times.
Ken,
Thank you, the file was corrupted. I have verified the fix is working now.
Thanks,
Doug