主要内容

Results for


In problem 16 I used the following solution:
function b = nearZero(a)
b = max(a(imdilate(a == 0, [1 1 1])));
end
It is working pretty well on mathlab but when I submit my answer to cody, the following error is generated:
Undefined function 'imdilate' for input arguments of type 'double'.
Error in nearZero (line 2)
b = max(a(imdilate(a == 0, [1 1 1])));
Error in Test1 (line 3)
assert(isequal(nearZero(a),b))
In number 5, its written that the correct answer is c = 1 but the secomnd person has more change than the first person, therefor the correct answer should be 2.Likewise in number 6.

Check out this pick of the week from Will. Steve's progressbar submission has been around since 2005 and still runs perfectly. Check out the blog post to see why Will picked it.

We are excited to announce that Adam Danz has accepted our invitation and now is a member of the Community Advisory Board (CAB)!

Adam has been a rising star in Answers, obtaining 4500+ reputation points in the past year! Furthermore, he has contributed high-quality files to File Exchange, with an average rating of 4.8. Adam also demonstrates good communication skills and the ability to work with others. Those characteristics are what we expect to see from a CAB advisor. You can learn more about him and CAB on the CAB page .

On behalf of all the community team, we would like to extend our warmest welcome to Adam!

Check out Sean's blog posts ( Intro , Authoring ) on Spider Plots. He's using spider_plot by Moses to create beautiful plots like this.

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.

Hi, I'm trying to solve this problem but I'm getting an error so far.
Problem:
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have
a = [1 2 2 2 1 3 2 1 4 5 1]
The answer would be 2, because it shows up three consecutive times
What I've written so far (not done):
a = [1 2 2 2 1 3 2 1 4 5 1];
[x,y] = size(a);
counter = zeros(1,10);
if x == 1
for i=1:1:y
if a(i) == a(i+1)
counter(a(i)) = counter(a(i))+1
end
end
else
for i=1:1:x
if a(i) == a(i+1)
counter(a(i)) = counter(a(i))+1
end
end
end
But it says "error" in the line of "if a(i) == a(i+1)". I noticed that it creates a variable called "i" which value is 11, but it should create a vector from 1 to 11. What's wrong here?
I know my solution might not be in the right direction or something, but please don't tell me anything!
Thanks in advance
Jan
Jan
Last activity 2024-9-30,7:01

After reading Rik's comment I looked for a list of Matlab releases and their corresponding features. Wiki: Matlab contains an exhaustive list, but what about having a lean version directly in the forum?
If this is useful, feel free to expand the list and to insert additions. Thank you.
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).
Dear Sir or Madam
I tried to solve the cody-problem namend in the title.
Could you pleas tell me how I should name the vektor/variable in which it should be presentet?
Thank you for helping me.
Yours faithfully
Jann Borlinghaus
Dear MATLAB community,
How can I help my close friend who's bad at math and programming learn MATLAB?
He's a final year chemical engineering student who struggles even to plot two functions on the same graph in his computational fluid dynamics class (there was no prereq for matlab skills).
In his first year, I saw him get dragged through the introductory engineering classes which was his first encounter with MATLAB. Students were taught a few rudimentary programming skills and then were expected to make a code for a 'simple' tic-tac-toe game. It took him hours of blank looks and tutoring to even understand the simplest of boolean operators. He was never able to write a working function without the supervision of a friend or tutor. Needless to say, he was permanently scarred by the experience and swore to avoid using it forever.
After 3 years of avoiding MATLAB, he realised how not knowing it hurt him during his final year project. He had to solve a system of pdes to model the performance of a reactor and practically speaking, MATLAB was the most suitable software at hand. He ended up having to get a friend to help him code the equations in while also having to oversimplify his model.
The weird thing is that: most students from his chemical engineering faculty were not expected or encouraged to use MATLAB, almost all of their prior assignments required no use of MATLAB except that infamous first year course, and most of his peers also avoided using MATLAB and resorted to Excel. It is my understanding that Excel cannot match MATLAB's efficiency and clarity when solving calculus problems so it was not uncommon to see extremely long Excel spreadsheets.
Anyway, my friend is, with the help of a friend's past year MATLAB codes, trying to finish up his computational fluid dynamics assignment that's due soon. He finishes university in 2 weeks time.
Even though he knows that not every engineer has to use MATLAB in the workplace, he somehow wishes he was able to learn MATLAB at his glacial pace. I find it such a pity that he was never able to keep up with the pace of learning that was expected which begs the question: are students who are too slow at learning programming better of in a different field of study?
If you've managed to read to the end of this, thank you so much. I just don't know how to help my friend and I'm hoping some of you might be able to suggest how I can help him be better at it. I believe he has potential but needs special help when it comes to MATLAB.
All helpful and constructive suggestions considered,
Thank You All