MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MATLAB:使用带字符串的If语句从其他数组返回值 (https://www.labfans.com/bbs/showthread.php?t=24074)

poster 2019-12-10 20:48

MATLAB:使用带字符串的If语句从其他数组返回值
 
我有一个matlab程序,我在其中从excel导入一些数组。我正在尝试编写一个在第一个数组中查找的if语句,例如:

Thing-1 Thing-1 Thing-3 Thing-5 如果列是“ Thing-1”,那么它将转到不同的数组,并计算3个要赋予不同变量名的值...任何指导将不胜感激!谢谢!



[B]回答:[/B]

您需要像Excel中的vlookup这样的功能。

我写了一个。这是源代码:

function [content, index] = vlookup(m, e, column, lookcolumn) if isempty(m) || isempty(e), return; end if nargin


所有时间均为北京时间。现在的时间是 23:24

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.