Question

3. Write a function called MessageDecode that matches an input string scalar to a known text message abbreviation, and output

matlab

0 0
Add a comment Improve this question Transcribed image text
Answer #1
function out = MessagesDecode(myString)
    switch myString
        case "BFF"
            out = "best friends forever";
        case "BTW"
            out = "by the wa";
        case "IDK"
            out = "I don't know";
        case "IMHO"
            out = "in my humble opinion";
        case "LOL"
            out = "laughing out loud";
        case "TMI"
            out = "too much information";
        otherwise
            out = "Unknown message";
    end
end

MessagesDecode("BFF")
MessagesDecode("ABC")

OUTPUT

ans = best friends forever ans Unknown message

Please up vote. I need it very badly right now.

Add a comment
Know the answer?
Add Answer to:
matlab 3. Write a function called MessageDecode that matches an input string scalar to a known...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT