I managed to achieve the desired outcome by configuring the s-function output as variable-size mode and set the current output dimension to 0 when there is nothing to output.
How can I stop C MEX s-function from outputting anything?
    7 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Sunny Talekar
      
 le 28 Juil 2017
  
    
    
    
    
    Réponse apportée : Sunny Talekar
      
 le 23 Fév 2018
            I have a C MEX s-function that receives some data, processes it and outputs an array.
I was wondering if there is a way to not output anything (instead of zeros) when the s-function does not receive anything. Inside the s-function I can detect whether anything has been received but I couldn't figure out a way to use this information to inhibit the output (e.g. show nothing when connected to a Display (sink)).
TIA,
0 commentaires
Réponse acceptée
Plus de réponses (1)
  Abhi Sundararaman
    
 le 31 Juil 2017
        It shouldn't be possible to remove the output entirely, since if there is an outport on your s-function block, there will always be an output signal.
However, if you want a visual indicator of the output being invalid (basically the same as outputting nothing), you could try outputting "NaN" instead of zeros.
Voir également
Catégories
				En savoir plus sur Block and Blockset Authoring dans Help Center et File Exchange
			
	Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

