How to display elements of Matrix by entering coordinates
2 次查看(过去 30 天)
显示 更早的评论
I want to display elements of a matrix by entering coordinates in the command window
Example:
1 0 0
0 1 0
0 0 1
if I enter disp(x(2,2));
I want to get 1
0 个评论
采纳的回答
Star Strider
2015-11-29
You have to assign the matrix to ‘x’ first:
x = [1 0 0
0 1 0
0 0 1];
disp(x(2,2))
1
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!