Others have addressed the other topics of this post, but I would like to comment about what I see as "reasonable expectations" for filtering homework questions. It might not be completely on-topic, but I feel it's important.
Oftentimes, it is explicitly clear that a thread is a homework question. Many users either state that they're working on homework or copy and paste their assignment in its original format into their post. It's also often quite clear that the user asking the question has no interest in producing a solution themselves and instead wants something that they can copy and paste into an .m-file for submission. In these situations, I see nothing wrong with letting the user know that they won't receive the type of "help" they're asking for.
That said, it requires little effort to mask that your question is about homework. Because we're not in any position to know the user's intent for the code on which they're working without them explicitly stating it, we are to some degree going to be giving out what some instructors find to be an inappropriate level of assistance. I think this is inevitable, and don't think we should be involved in the guessing game that is trying to figure out who is cheating on an assignment and who isn't. While it's not an ideal situation, classes should be set up with enough exams or large projects that you can't get by just by copying some simple scripts from an online forum, anyway.
Unless we have clear evidence that a question is about homework, we should assume it isn't. If we try to play detective, we'll end up punishing users for the crime of posing their problems as simplified scenarios that end up inadvertently looking like something out of a textbook or assignment page. I look back at some of the early questions that I posed here, and the examples I gave that demonstrated my problem were so simple, and the problems themselves so basic, that were I looking on them now I would be tempted to think past me was asking about homework.
This means that some users will able to get by with having an unfair level of help just by saying "this is for a job" or "I'm just trying to teach myself with this example." It's unfortunate, and we could perhaps mitigate it by providing generalized answers + an explanation of each line of code, but in the past I've seen people be outright refused help because everyone assumed they were working on homework, even when there was no convincing evidence to support that.