如何解释r1与c1的数值的意思

9 次查看(过去 30 天)
雪明 邓
雪明 邓 2021-12-6
回答: Aditya 2024-2-23
clear;
[X,Y]=meshgrid(10:10:1000);
[r1,c1]=find(X<=Y&0<Y&Y<=400&X>0)
代码如上
这样会生成一个变量r1与c1,这两个变量里的值是什么意思

回答(1 个)

Aditya
Aditya 2024-2-23
Hi 雪明 ,
I understand that you're looking for an explanation of the numerical values in the variables r1 and c1 produced by your MATLAB code. The values in r1 represent the row indices and the values in c1 represent the column indices of elements in matrices X and Y that meet the specified conditions: X is less than or equal to Y,Y is positive and less than or equal to 400, and X is positive.
In essence, r1 and c1 tell you the positions of the points in the grid formed by meshgrid where the conditions are true.
For more information on “find” function, refer to the MATLAB documentation here:
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 时序 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!