![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176703/image.png)
access row and column number in variable editor
2 次查看(过去 30 天)
显示 更早的评论
How can I access the row- and columnnumbers of one (or more) selected entries in a vector, displayed in the variable editor? The information is shown in the toolstrip on the screen, but how can I get these information via command window?
edit: I need to get the selected range, not the data inside this range
example:
XX = rand(10);
now I open the variable editor and select manually the rows 3 to 7 and comlumns 4 and 6. Now I need a function which output is:
selectedRows = 3,4,5,6,7
selectedColumns = 4,6
0 个评论
回答(1 个)
Orion
2014-11-12
Access it with the index of your data.
XX = rand(10);
edit with the vriable editor and select some part:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176703/image.png)
then, in Matlab :
>> XX(3:7,[4,6])
ans =
0.2769 0.6551
0.0462 0.1626
0.0971 0.1190
0.8235 0.4984
0.6948 0.9597
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!