Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab if-else, switch, pattern matrix output Write a function named myFunction(M,N,C) who would accept input integers M N, and a charactor c in upper case

Matlab

image text in transcribedimage text in transcribed

if-else, switch, pattern matrix output Write a function named myFunction(M,N,C) who would accept input integers M N, and a charactor c in upper case and output a M by M matrix whose elements are almost all M except on one of the four edges all N, following the rules: C="E', meaning east, right edge; c='W', left edge; c='N', upper edge; c='S', lower edge input c must be among EWNS, and your function should be able to throw an error message in the case that input c is not one of EWNS. For example: (4,2,'E') would return 4 4 4 2 4 4 4 2 4 4 4 2 4 4 4 2 (3,11,'S') would return 3 3 3 3 3 3 11 11 11 (3,11,'x') would return input x not allowed, must be one of EWNS Notes: you are going to use a lot of ones(); also, need to use the switch clause, Function 1 Code to call your function 1 myFunction (4,2, 'E')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

=+4. About the medium.

Answered: 1 week ago