Add String to Matlab Plot Annotation
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    david crowley
 el 26 de Jul. de 2021
  
    
    
    
    
    Respondida: Chunru
      
      
 el 26 de Jul. de 2021
            I am trying to add an annotation to a plot that uses a variable from the workspace. I have used the below code, but the only output I get is 'Pf Size:'
Can someone please assist with the syntax?
dim = [.2 .5 .3 .3];
str = ('Pf Size:' num2str(pfSize));
annotation('textbox',dim,'String',str,'FitBoxToText','on');
0 comentarios
Respuesta aceptada
  Chunru
      
      
 el 26 de Jul. de 2021
        pfSize = 2;
dim = [.2 .5 .3 .3];
str = ['Pf Size:' num2str(pfSize)];  % use [] instead of ()
plot(rand(10,1))
annotation('textbox',dim,'String',str,'FitBoxToText','on');
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Annotations 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!
