enable/disable parameter in embedded matlab function
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hello, i've got an embedded matlab function with several parameters(variables). I try to enable/disable parameter 1 and 2 in dependency on parameter 3. Means, if the value of parameter 3 is "1", parameter 1 is enabled and parameter 2 is disabled. If the value of parameter 3 is "2", both parameters are enabled. Is there a possibility for this?
2 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 16 de Mzo. de 2013
Editada: Azzi Abdelmalek
el 16 de Mzo. de 2013
function y=fcn(a,b,c,d)
if d==1
y=a
elseif d==2
y=a+b
elseif d==3
y=a+b+c
end
%or
function y=fcn(a,b,c,d)
v=[a b c];
y=sum(v(1:d))
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!