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
  • Text message abbreviation decoder (Java) (1) Complete the following method: /** * Decodes the text abbreviation....

    Text message abbreviation decoder (Java) (1) Complete the following method: /** * Decodes the text abbreviation. * * @param textAbbr Text abbreviation. * @return The decoded abbreviation if known. Otherwise, returns Unknown. */ public static String decTextAbbr(String textAbbr) { // FILL IN BODY } If the parameter matches a known text message abbreviation, return the unabbreviated form, else return: Unknown. Support two abbreviations: LOL -- laughing out loud, and IDK -- I don't know. For example: decTextAbbr("LOL") returns laughing out...

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