Writing a user-defined function.

Can some one please help me with this. I don't know where to start. Write a user-defined function named topBottomDifference that takes a single input, a matrix, and returns a vector of the difference between the first row of the matrix and the last row of the matrix.

댓글 수: 1

David Fletcher
David Fletcher 2021년 4월 21일
The best place to start might be to invest a few hours in Matlab Onramp. It will cover everything you need to know to complete your task.

댓글을 달려면 로그인하십시오.

답변 (1개)

DGM
DGM 2021년 4월 21일

0 개 추천

Well,
row1=mymatrix(1,:);
is the first row of a matrix, and
row2=mymatrix(end,:);
is the last row.
And you can write a function like so:
There's also more info in the Topic section at the end of that page.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

질문:

2021년 4월 21일

답변:

DGM
2021년 4월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by