Need help creating a two separate matrices; one matrix is a 5x5 and has ones in columns 1, 3, and 5. The other matrix is also 5x5, but in the elements in the fifth column are equal to the row number that they are on.
3 次查看(过去 30 天)
显示 更早的评论
I'm supposed to use loops and/or conditionals to achieve the arrays. I'm not sure where to start; any help is appreciated!
1 个评论
回答(1 个)
Kevin Phung
2019-2-19
if you're looking for hints, check out the functions:
size()
ones()
zeros()
and this documentation on array indexing:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!