What does "undefined eq" means on fixed.Interval command
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 9 de Mzo. de 2023
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 comentarios
Walter Roberson
el 9 de Mzo. de 2023
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
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!