Question

Function Name: stPaddysFeast Example search- Inputs 1 (struct) A MxN structure array 2. double) A 1x2 vector of your startingUsing MATLAB, please read question well

Comments
    0 0
    Add a comment Improve this question Transcribed image text
    Answer #1

    function found = stPaddysFeast(search,ind)
    i=0;
    while ~(strcmp(search(ind(1),ind(2)).food,'corned beef'))
        if (strcmp(search(ind(1),ind(2)).food,'potato'))
            i=i+1;
        end
        ind=search(ind(1),ind(2)).next;
    end
    found=sprintf('I found %d potatoes before I reached the corned beef at position (%d,%d).',i,ind);

    Command Window >>search (1,1) .next [1,3]: search (1,1) .food- potato search (1,2) .next- [1,1] search (1,2) .food- search (

    Add a comment
    Know the answer?
    Add Answer to:
    Function Name: stPaddysFeast Example search- Inputs 1 (struct) A MxN structure array 2. double) A...
    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