Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我有一个matlab程序,我在其中从excel导入一些数组。我正在尝试编写一个在第一个数组中查找的if语句,例如:
Thing-1 Thing-1 Thing-3 Thing-5 如果列是“ Thing-1”,那么它将转到不同的数组,并计算3个要赋予不同变量名的值...任何指导将不胜感激!谢谢! 回答: 您需要像Excel中的vlookup这样的功能。 我写了一个。这是源代码: function [content, index] = vlookup(m, e, column, lookcolumn) if isempty(m) || isempty(e), return; end if nargin |
![]() |
![]() |