Where is the problem???
1 次查看(过去 30 天)
显示 更早的评论
Hi,
UserData.matrix(3,3) is type of cell, and d is also type of cell. I got this error:
??? Error using ==> mupadmex Error in MuPAD command: Can't evaluate to boolean [bool];
during evaluation of 'subproc'
Error in ==> sym.sym>sym.eq at 755 X = mupadmex('symobj::eq',A.s,B.s,9);
Error in ==> Simulator>vzaj_indukc_Callback at 5432 find(sym(UserData.matrix(3,3))==sym(d))
Why? Here is the code:
find(sym(UserData.matrix(3,3))==sym(d))
6 个评论
Walter Roberson
2013-9-10
Is UserData.matrix(3,3) a cell that contains the symbolic expression
L1,ww,3||L2,M2,2||L3,f44,2.4
? I am not sure how you would construct such an expression in MuPAD; would it be via
(L1,ww,3)||(L2,M2,2)||(L3,f44,2.4)
thus constructing sequences joined by ? Or is it a vector entry, sort of a Vector((L1,ww,3), (L2,M2,2), (L3,f44,2.4)) with sequences as each of the vector entries? Or is it a 3 x 3 matrix,
L1 ww 3
L2 M2 2
L3 f44 2.4
??
采纳的回答
Image Analyst
2013-9-10
Don't cast to anything! Just use strfind():
string1 = 'L1,ww,3||L2,M2,2||L3,f44,2.4'
d = 'L1'
location = strfind(string1, d)
if ~isempty(location)
message = sprintf('%s was found\nin %s\nat index %d.',...
d, string1, location);
else
message = sprintf('%s was NOT found in %s.',...
d, string1);
end
uiwait(msgbox(message));
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!