主要内容

Results for


The following is a list of updates and new features for MATLAB Central, including MATLAB Answers, File Exchange, Blogs, and Cody.

New Features

Community highlights channel released - See this post for more details.

Answers comment UI change - A minor improvement to the user interface when adding comments to questions and answers in MATLAB Answers. This change should make it easier to discern between commenting and adding a new answers to a question.

Answers rich text editor update - The rich text editor has been updated to the 19b version of the MATLAB Live Editor. This update will primarily help with syntax highlighting along with resolving a few other issues.

Answer pages translation option - Answers translations options added. A translation option for questions and answers content has been added for French, German, Italian, Spanish, and Chinese languages.

Hey everyone! I'm spotlighting Nikolaos Nikolaou today because of the sheer quantity of his Cody solutions over such a relatively short time span. Nikolaos has submitted 1,161 Cody solutions over the last 6 months of 2019, averaging 6.4 solutions per day. Achieving a Cody rank of 19 with a score of 18,820 and earning him a plethora of badges (including the Speed Demon badge of course). He's completed 24 problem groups and is well into most of the remaining 35.

Way to go Nikolaos!

Check out digCircs by Graham W Griffiths, this weeks pick by Sean . Read Sean's blog post about why he picked Graham's submission this week.

Please post any comments to Seans's blog post here.

Check out nextname by Stephen Cobeldick, this weeks pick by Jiro. Read Jiro's blog post about why he picked Stephen's submission this week.

Please post any comments to Jiro's blog post here.

I'm please to announce this new MATLAB Central feature for posting community highlights. This new channel will:

  • Allow MathWorks and the community leaders to easily post newsworthy items to the community
  • Allow community visitors to respond to these posts with Likes and Replies
  • Allow anyone to follow/subscribe the channel so they can be notified of new posts

What do we mean by newsworthy?  In short, this means anything we think some or all of the community might like to know. Here are some examples of what we’re thinking about posting to this new channel.

  • New or upcoming community features or events
  • User highlights (e.g. examples of good behavior, interesting posts)
  • Interesting content (e.g. File Exchange pick of the week submissions)
  • Release notes and new features
  • Polls (future)

New highlights will appear on the community home page at the time they are posted and all past highlights can be found by going to the community home page and clicking the Highlights link in the right column.

As always, let us know what you think by liking this post or commenting below.

The following is a list of updates and new features for MATLAB Central, including MATLAB Answers, File Exchange, Blogs, and Cody.

New Features

Profile search - A global community profile search has been added. The search field on community profile pages has been updated from a standard content search to a user profile search. This improvement makes it easier to find community members across all MATLAB Central. Previously one had to search the Answers contributors , File Exchange authors , and Cody players page when looking for a user profile.

Last seen - We have added a 'last seen' timestamp to community profiles which displays the date of a person's last visit to MATLAB Central. This can be a relevant bit of information and help determine how recent someone has been active in the community.

Answers pages design update - Answers Q&A pages have been updated to remove extra white space. This update includes smaller sized avatars, and position changes for the voting and content actions among other small changes. All these changes also help improve the mobile experience as well.

Original poster styles - Original poster styles have been introduced in Answers. When a question author participates in a Q&A thread their comments or answers will be styled with a blue background and left border so they're easily discernable from other contributors.

File Exchange data in monthly emails - File Exchange stats will be included in the monthly email we send to contributors who've participated in the community on any given month.

Trending content algorithm - The MATLAB Central home page trending content algorithm has been updated to look at content activity over a shorter period of time resulting in a more dynamic feed.

Walter Roberson does it again by winning the coveted MOST ACCEPTED answers badge for all his contributions in MATLAB Answers this past year. Walter has won this badge every year since 2015. It was way back in 2014 when Image Analyst out paced Walter and was awarded the badge.

There are 10 community members who have achieved the Top Downloads badge for their popular File Exchange submissions in 2019. Do you recognize any of these names? There's a good chance you've used one or more of their toolboxes or scripts in your work if you're a frequent visitor to File Exchange, if you're not you might want to check out what they've posted, it may save you a lot of time writing your own code.

--------------------- Top Downloads Badge Winners -----------------

Congratulations to all these winners and a giant THANK YOU for all they've done this past year to help everyone in the MATLAB Central community!

We are happy to announce that virtual badges can now be achieved for participating in MATLAB Central File Exchange . We have 30 badges that anyone can achieve, which will also boost your community profile. Some badges are relatively simple to get while others will depend on how useful your submissions are to others in the community. Check out Ned Gulley's blog post for a great introduction.

Explore resources, ask questions, and discuss topics related to using Simulink to apply power electronics control to Electric Vehicles, Renewable Energy, Battery Systems, Power Conversion, and Motor Control. This is the 3rd MATLAB Central community, after Maker and SimBiology , and is moderated by Tony Lennon . Tony is the Power Electronics Marketing Manager at MathWorks.

Visit the community here . As always, let us know what you think by liking this post or commenting below.

Rik
Rik
Last activity 2022-11-4

There are multiple ways to create a graphical user interface (GUI) in Matlab. Which method is the best depends on multiple factors: the complexity of the project, to what extent it should be a long-term solution, on what releases your GUI should work, your available time, your skill level, and probably other factors I'm forgetting.
To keep the thread clear I'll attempt to provide a short outline a few ways in this question, and leave the details for the answers. (@anyone with editing privileges: feel free to update the section below if I missed something important and am slow in editing this question)
---------------------------------------------------------------------------------------------------
GUIDE
GUIDE is probably the first tool new users will encounter. It is very useful for quickly putting something together, but it is otherwise fairly limited. It requires maintaining (and distributing) both a .m and a .fig file. Note that the GUIDE environment will be removed in a future release. After GUIDE is removed, existing GUIDE apps will continue to run in Matlab but they will not be editable in GUIDE. If you're starting a new GUI, don't use GUIDE. If you're updating an existing GUIDE GUI, migrate it to AppDesigner. In R2021a the first step for this removal was taken: all templates except the blank template have been removed.
GUILT
Although I haven't had a detailed look myself, it seems a list like this is not complete without at least mentioning the GUI Layout Toolbox, which is available on the file exchange and offers a lot of customization options.
Programmatic GUIs
You can bypass GUIDE and use the normal figures and functions like uicontrol to build GUIs from code. This makes the design less visual, but more flexible for future additions.
App Designer
The official successor to GUIDE, AppDesigner is not based on functions, but works similar to a class. It uses uifigure and mostly uses graphical elements that are incompatible with 'normal' GUIs that are created with a figure (or .fig).
This is the 5th installment of the wish-list and bug report thread.
This topic is the follow on to the first Wish-list for MATLAB Answer sections and second MATLAB Answers Wish-list #2 (and bug reports). The third started out as New design of the forum - grey on white and the fourth MATLAB Answers Wish-list #4 (and bug reports) is also growing so large it is slow to load and navigate.
Same idea as the previous ones: one wish (or bug report) per answer, so that people can vote their wishes.
What should you post where?
Wishlist threads (#1 #2 #3 #4 #5 #6): bugs and feature requests for Matlab Answers
Frustation threads (#1 #2): frustations about usage and capabilities of Matlab itself
Missing feature threads (#1 #2): features that you whish Matlab would have had
Next Gen threads (#1): features that would break compatibility with previous versions, but would be nice to have
@anyone posting a new thread when the last one gets too large (about 50 answers seems a reasonable limit per thread), please update this list in all last threads. (if you don't have editing privileges, just post a comment asking someone to do the edit)
Summary:
Dynamically accessing variable names can negatively impact the readability of your code and can cause it to run slower by preventing MATLAB from optimizing it as well as it could if you used alternate techniques. The most common alternative is to use simple and efficient indexing.
Explanation:
Sometimes beginners (and some self-taught professors) think it would be a good idea to dynamically create or access variable names, the variables are often named something like these:
  • matrix1, matrix2, matrix3, matrix4, ...
  • test_20kmh, test_50kmh, test_80kmh, ...
  • nameA, nameB, nameC, nameD,...
Good reasons why dynamic variable names should be avoided:
There are much better alternatives to accessing dynamic variable names:
Note that avoiding eval (and assignin, etc.) is not some esoteric MATLAB restriction, it also applies to many other programming languages as well:
MATLAB Documentation:
If you are not interested in reading the answers below then at least read MATLAB's own documentation on this topic Alternatives to the eval Function, which states "A frequent use of the eval function is to create sets of variables such as A1, A2, ..., An, but this approach does not use the array processing power of MATLAB and is not recommended. The preferred method is to store related data in a single array." Data in a single array can be accessed very efficiently using indexing.
Note that all of these problems and disadvantages also apply to functions load (without an output variable), assignin, evalin, and evalc, and the MATLAB documentation explicitly recommends to "Avoid functions such as eval, evalc, evalin, and feval(fname)".
The official MATLAB blogs explain why eval should be avoided, the better alternatives to eval, and clearly recommend against magically creating variables. Using eval comes out at position number one on this list of Top 10 MATLAB Code Practices That Make Me Cry. Experienced MATLAB users recommend avoiding using eval for trivial code, and have written extensively on this topic.
Edit: due to the increasing size of this thread, it is continued here.
What should you post where?
Wishlist threads (#1 #2 #3 #4 #5 #6): bugs and feature requests for Matlab Answers
Frustation threads (#1 #2): frustations about usage and capabilities of Matlab itself
Missing feature threads (#1 #2): features that you whish Matlab would have had
Next Gen threads (#1): features that would break compatibility with previous versions, but would be nice to have
@anyone posting a new thread when the last one gets too large (about 50 answers seems a reasonable limit per thread), please update this list in all last threads. (if you don't have editing privileges, just post a comment asking someone to do the edit)
This topic is for features you would like to see for the MATLAB Answers facility itself, and also for bug reports about the MATLAB Answers facility.
This topic is the follow on to the first Wish-list for MATLAB Answer sections and second MATLAB Answers Wish-list #2 (and bug reports). Those grew large enough to become unwieldy; and Mathworks has made enough changes to make a number of the past points no longer of relevance. More recently there was the limited purpose New design of the forum - grey on white which turned into a bug and wish list; I have renamed that for continuity.
I suggest one wish (or bug report) per answer, so that people can vote their wishes.
The community is very helpful, yet I feel really powerless that I cannot find the appropriate way to code, nor find the problems with the codes I have written. I have read numerous books on MATLAB, mostly related with science and engineering applications. Any advice to improve would be greatly appreciated. Thanks.
NOTE: this discussion is continued at MATLAB Answers Wish-list #6 (and bug reports)
I've opened MATLAB Answers this morning and found the new design.
The field for typing the "Body" does not consider the font settings of my browser anymore, such that my preference of sans-serif fonts is ignored. In addition the text color is a medium gray, which is hard to read for me due to the too light contrast.
Blank lines in the code let two separate code boxes appear. This makes almost all code, I've posted in the forum, invalid. It has been discussed repeatedly, that blank lines in the code confuse the indentation of the display in the forum and that this is a really bad idea. But instead of improving this, it is made severely worse now.
The new design contains even more white space, such that standard questions cannot be answered without extensive vertical scrolling. It is a very bad drawback, that I cannot see the question while I type the answer.
There is still no suggestion to use a proper code formatting, such that I have to spend 20% of my forum time typing corresponding comments as before.
But I'm coming back to the most important problem for me: It is a physical problem for me to read the low contrast grey on white text. Does anybody know a tweak or CSS trick to increase the readability?
TMW, please take into account that this new design is physically hard to read for people without young and 100% perfect eyes. This is very annoying for me.
Splitting code blocks at white lines is simply a bug. I cannot imagine why this error has not been detected before the new design has been published. The argument, that TMW is extremely conservative with changes in the forum to ensure a stability does not convince me anymore.
[EDITED] The box around the thread, the preview box, the boxes for preformatted text and code have a grey background now. So some text is even medium grey on light grey.
I'd be glad if the designers refocus on the purpose of the forum. Whatever this purpose might be, the optical reception of the characters is fundamental.
What MATLAB tools or functions have you been thinking about making but haven't quite gotten around to it?
It can be something specific to your work if you'd like, but it's preferably:
  • the kind of tool or task that we don't really expect in the next MATLAB release (ie., not a frequent entry in a MATLAB wishlist)
  • something that would be useful to you and (hopefully) others if it existed.
  • something that could conceivably be made by people(s) in the user community
Think of it maybe as a file exchange wishlist.
Votes for good ideas . I guess you'll get more votes if it's an idea others want to see made as well.
Probably no single accepted answer, but it would be nice to see what people have thought about and maybe we can bring a few ideas to fruition (or find that someone's already done it)
For example:
  • I've been wanting to write an object-oriented replacement for the NURBS toolbox which is a great toolbox but is very unwieldy to use.
I would like to receive your feedback:
  • would you find useful to have spellcheck built into the MATLAB Editor?
(Consider also an associated toggle, positioned somewhere in the Editor, that would enable/disable the spellcheck for selective use)
Lately, I am writing many quick analyses for publish() and I find that first publishing to MS Word (to check the spelling) and then re-publishing to .html, after manual corrections, disrupts the working.
IMHO, the idea to include spellcheck into the editor would be consistent with the renewed visibility of the PUBLISH tab.
NOTE: this discussion is continued at MATLAB Answers Wish-list #6 (and bug reports)
This topic is for features you would like to see for the MATLAB Answers facility itself, and also for bug reports about the MATLAB Answers facility.
This topic is the follow on to the earlier Wish-list for MATLAB Answer sections. That topic grew large enough to become unwieldy; and Mathworks has made enough changes to make a number of the past points no longer of relevance. There was also a more limited purpose <http://uk.mathworks.com/matlabcentral/answers/216662-new-design-of-the-forum-grey-on-white-wish-list-3-bug-reports
I suggest one wish (or bug report) per answer, so that people can vote their wishes.
Hello all,
Please explain good MATLAB programming practice methods. It will help to the guys who are new to programming like me.
Previously I used
for i=1:10
after following some suggestions from this answers pages I learnt to use
for i1=1:100
This is the good way to write programs.
Like this, as a professional programmer, please mention some good programming practice techniques.
It will useful to all!