Write a function that takes a 2D matrix/1D vector x as input and returns a row vector containing the number of rows and the number of columns of the matrix. If the input matrix is empty return -1 for both the number of rows and columns.
You are not allowed to use the MATLAB built-in functions:
size
length
numel
height
width
sum
find
max
min

Solution Stats

1 Solutions

1 Solvers

Last Solution submitted on Mar 01, 2026

Last 200 Solutions

Solution Comments

Show comments
Loading...

Problem Recent Solvers1

Suggested Problems

More from this Author3

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!