Writing a user-defined function.
2 ビュー (過去 30 日間)
古いコメントを表示
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
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
2021 年 4 月 21 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!