create static method in app designer
    12 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    dleal
      
 el 29 de Jun. de 2022
  
    
    
    
    
    Respondida: Cris LaPierre
    
      
 el 29 de Jun. de 2022
            Hi all, 
How do I create static methods in the App Designer? The dropdown menu only allows me to create either public or private functions. 
I couldn't find any explicit documentation about this.
0 comentarios
Respuesta aceptada
  Cris LaPierre
    
      
 el 29 de Jun. de 2022
        I'm assuming you want a static method so that the first input does not have to be an object of the class. The way I could do this was to manually create a 'methods (Static)' section below my app properties. This is the same place a custom function (public or private) would appear. For example
    properties (Access = private)
        x 
    end
    methods (Static)
        function out = myFxn(in)
            out = 2*in;
        end
    end
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Develop Apps Using App Designer 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!

