📄 find_index.m
字号:
function index = find_index(num,table)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %
%% Name: find_index.m %
%% %
%% Description: It receives a table and a number to look for in %
%% first column. %
%% %
%% Result: It gives back the corresponding value of the second %
%% column. %
%% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dim = size(table);
num_col = dim(1);
for i=1:num_col
if num==table(i,1);
index = table(i,2);
return
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -