Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use MatLab 5) Write a function CheckMatrix that will check whether an input argument is a scalar, a onedimensional vector, or a two-dimensional matrix.

Please use MatLab image text in transcribed
5) Write a function CheckMatrix that will check whether an input argument is a scalar, a onedimensional vector, or a two-dimensional matrix. This function receives a variable as the only input argument, and returns the variable type as a character vector (a string). Your function should also check if the input is empty. If that's the case, the function should output 'empty'. Hint: consider using the size() function. To test your function, try the following examples: > type = CheckMatrix (4.0) type = > type = CheckMatrix (1:10) type = 'vector' > type = CheckMatrix (rand (3)) type = 'matrix' > type = CheckMatrix ([]) type = 'empty

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

Step: 3

blur-text-image

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

What were the issues and solutions proposed by each team?

Answered: 1 week ago

Question

3. Who would the members be?

Answered: 1 week ago