I have very basic knowledge in matlab programming. So, I decided to improve my matlab programming knowledge by doing some Matlab Cody exercises. As I'm a beginner in Matlab Programming, I couldn't able to solve more than 10 problems in Matlab Cody. I have tried to look at others soultions . Unfortunately , I cannot see others solutions. I cannot even see the solutions of others for the problems that I have already solved. Then what is the purpose of Cody when you cannot improve your coding by looking at various possibilities of solutons from others. It really didn't make any sense for me . Can somebody tell me the way to improve my coding knowledge in matlab?

8 Kommentare

Adam
Adam am 5 Sep. 2019
Yeah, when I tried Cody I found it similarly useless. The idea is good, but every problem has at least one person who has implemented what is basically a 'cheat solution' rather than a proper solution and not being able to see better solutions when you have already submitted yours makes it pretty poor for learning. It's more of place for people to show off 'clever', but ultimately very poor solutions to problems!
I learned Matlab simply through using it to do some task I wanted to do and then carrying on doing that, adding more and more knowledge as I went. My first code was utterly appalling, but it mostly did the job I needed it to and I kept learning ways to improve it as I went, using the documentation, which, with a few exceptions, is excellent, as well as Matlab Answers and other such resources. Mostly I just tried things out though and made heavy use of the command line or short standalone testing scripts to try out different things.
Stephen23
Stephen23 am 5 Sep. 2019
"...I decided to improve my matlab programming knowledge by doing some Matlab Cody exercises."
Cody is terrible way to learn MATLAB.
Cody is a game, they are not "exercises" intended for learning.
Because of its basic ranking system, Cody users rely on lots of hacks and cheats to gain an advantage. Whilst entertaining for those with some MATLAB knowledge, few of those methods would be suitable for real MATLAB code written for real problem solving in the real world.
You should learn MATLAB by doing tutorials or courses, rather than unsuitable Cody:
Naga
Naga am 5 Sep. 2019
Thank you so much Adam and Stephen for your suggestions
Guillaume
Guillaume am 5 Sep. 2019
We (the community advisory board, and Grant in particular) have had plenty of discussions on improving cody and there's a genuine desire to make it suitable for learning. Cody has tremendously improved and there's plenty of discussion going on in order to stop the cheating and also provide other scoring metrics.
I think it's a bit unfair to say that cody is not suitable to learning. It's much better curated nowadays. There are plenty of problems in the basic categories focused on learning matlab. But indeed, as a beginner of matlab, you shouldn't focus on trying to get the best score as the lowest scoring solutions are often cheats, although last I checked most old cheats no longer work. If you want to learn from cody, ignore the solutions that use regexp, str2num !echo and other strange constructs . They're just gaming the system.
There's also plenty of challenging problems that are difficult to cheat and if answered properly will teach you to design algorithms.
Adam
Adam am 5 Sep. 2019
Actually when I did take a quick look today I was able to see all solutions to problems in a block where I have answered others. At the time I answered them (a couple of years ago maybe) this didn't seem to be working at all and I wasn't able to see better solutions even after completing a whole string of problems. Either it has improved in that respect or it was just not working properly on that day for some reason.
goc3
goc3 am 5 Sep. 2019
Thank you, Guillaume, for your response and the mention. In light of what has already been posted here, I would indicate that Cody is not the place to go for gaining rudimentary knowledge of MATLAB programming. As has been mentioned, there are great resources for this purpose, such as MATLAB Onramp.
However, once a user has basic knowledge of MATLAB programming, Cody is the perfect place to test one's skills and learn new tricks that can help improve day-to-day programming.
Now, lest anyone misinterpret "tricks," I am not referring to the eval, regexp, etc. hacks and cheats that are used to artificially minimize scores, but rather alternate function usage and creative combinations of built-in functions to perform tasks such as converting a number to an array of its digits and vice versa. There aren't built-in functions in MATLAB to do everything, but those that do exist can be combined in clever and efficient ways to create your own building blocks for more advanced code. And, Cody problems and (non-cheating) solutions can help users to write more efficient code. While cheats and hacks have plagued many problems, there are still many helpful solutions from various contributors, especially those in the top 20, or so. (Pro tip: if you're looking for helpful solutions, click on those that have different scores than yours and are not equal to the most common score.)
The Groups page of Cody contains over 60 curated problem groups (and counting) that cater to a variety of topics and skill levels. For beginners, I would recommend the Indexing series I, II, III, IV, V; Matrix Manipulation I, II, III; Matrix Patterns I, II, III; Sequences & Series I, II, III; Strings I, II, III (each roman numeral links to a different group). There is also a series of "Basics" groups that could be helpful (see the Groups page previously linked). Some of the other groups contain problems for intermediate and/or advanced coders.
I have found Cody to be a very useful tool to motivitate someone looking to improve their programming skills. And, the Cody team has put in consistent effort to improve the site over the years. Give it a shot.
Ned Gulley
Ned Gulley am 5 Sep. 2019
Grant (@goc3 above) is being modest, but he's been the one to create most of the groups you see on Cody. As he says, "Indexing I" (https://www.mathworks.com/matlabcentral/cody/groups/12) is a good place to start if you're just at the beginning of your MATLAB career. The "Cody Challenge" also has a lot of basic problems (https://www.mathworks.com/matlabcentral/cody/groups/2).
The idea behind Cody as a game is that we don't want to make it too easy for you to see other people's answers before you try to solve the problem. Otherwise it's too tempting to simply look at the answer before you make an effort. But after you've solved a few problems, you can go bck and look at answers from earlier problems and all the answers will be visible to you.
Speaking for myself, I would say that some of my best learning happens when I work hard on a problem, come up with an answer, and only THEN peek at other people's solutions. You learn amazing stuff that way.
And Guillaume and Grant have both pointed out that there are dumb cheats that you should just ignore. Learn from what's good. Don't learn from what's bad.
Stephen23
Stephen23 am 6 Sep. 2019
"...there are dumb cheats that you should just ignore. Learn from what's good. Don't learn from what's bad."
This is begging the question: exactly how is a beginner supposed to know the difference?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 5 Sep. 2019
Bearbeitet: Cris LaPierre am 5 Sep. 2019

1 Stimme

Cody is meant more as a game. It offers a chance to solve various challenges and then compare your solution to what others with "larger" solution sizes have done. That is the one caveat - you can't see solutions smaller than your code size.
If you want to learn more about coding, you should instead consider going through a self-paced training or online class. In MATLAB, click on the Learn MATLAB button.
This will take you to the MATLAB and Simulink Training page. If you are new to MATLAB, the best place to start is with MATLAB Onramp, a free, 2 hour introduction to programming in MATLAB. Other free onramps introduce you to Simulink and Deep Learning. Only the Onramps are free, but if you are a student, you may have access to additional courses. Use the My Courses page to explore.
On a new install, there is also a Getting Started banner that takes you to the Getting Started with MATLAB page. Here, you will find tutorials and additional info to help you learn.
If you would like more of a formal introduction, consider looking at MOOCs (Massive Open Online Courses). For example, Introduction to Programming with MATLAB on Coursera.

Weitere Antworten (3)

Israt Jahan
Israt Jahan am 4 Jul. 2020

5 Stimmen

I think Cody is a great platform to improve someone's coding skill. Although I was familiar with MATLAB since my undergrad, I was not very good at it. So when I first started using Cody, I was finding it difficult to solve problems because of my lacking of programming skill. So I completed the tutorial MATLAB Onramp and then solved the problems of MATLAB Onramp practice. After that, I was able to solve problems from other problem groups. I do not care what the leading solution size is and if my solution is much bigger than the leading solution as long as my solution works fine. I can feel that my programming skill is improving day by day. I have tried a few other online courses but no other platform or online course has overcome my fear of coding as Cody did.
And I think it is actually helpful that I can't see others' solutions unless I have submitted mine. If there was an option to see solutions beforehand, I think I wouldn't have tried on my own the way I do now.
Guillaume
Guillaume am 5 Sep. 2019

2 Stimmen

Once you solve a problem, you can see other solutions of the same size or larger. You won't be able to see smaller solutions until you solve another problem in the same category. If that is not what is happening, then give us the list of problems you have solved and I'll ask the cody people to look at it.
Indeed there is not currently any way to see the solution to a problem you haven't solved. But any solution, even if not very good will allow you to unlock all the solutions (once you solve another problem).
Yuanhao Zhu
Yuanhao Zhu am 2 Aug. 2021

0 Stimmen

You could check others solution by going to the "Solution Comment" section (while you can't access to the section while you're "solving" the question). Click on the blue hyperlink text called "Solution XXXX(a few numbers)", then you should be able to see their answers.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by