What does "undefined eq" means on fixed.Interval command
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, I'm trying to write a switch case with intervals but I keep gettin this error: Undefined function 'eq' for input arguments of type 'fixed.Interval'. I don't know what that means. I'll attatch the code I'm trying to run.
unitVc=app.DropDownVC.Value;
switch unitVc
case app.Vc.Value==fixed.Interval(0,60)
f=warndlg('El Volumen de carga debe ser menor o igual a 60 L');
end
UnitVc, DropDownVc and app.Vc.Value were previously defined. Thanks
0 件のコメント
回答 (1 件)
Walter Roberson
2023 年 3 月 9 日
switch true
case ~contains(fixed.Interval(0,60), unitVc)
but are you sure it is wise to use the Fixed Point Designer facilities for a UI task? Wouldn't it make more sense to test
switch true
case unitVc < 0 | unitVc > 60
3 件のコメント
Walter Roberson
2023 年 3 月 9 日
Does your dropdown have entries such as '100L' or '100 L' ? Entries such as '0.03 m³' in the same dropdown ?? Entries with negative numbers ?? Entries where the number is not the first thing in the entry?
If your entries are text then you should
Vc_okay = false;
switch unitVc
case {'-400 L', '-0.4 m³', '0 L', '0 m³', '75 L', '0.75 m³', '100 L', '1 m³', '250 L', '2.5 m³'}
f = warndlg('El Volumen de carga debe ser menor o igual a 60 L / 0.06 m³');
otherwise
Vc_Okay = true;
end
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!