How do you print an anonymous function properly in a figure title?
Afficher commentaires plus anciens
I am trying to print an anonymous function as part of a title for a plot. I would like it to look like a latex entry where
but we get f(x)=@(x)x.^2 instead.
I have provided a MWE below;
f=@(x) x.^2
x_coordinates=[1:10]
fx=f(x_coordinates)
plot(x_coordinates,fx)
title(sprintf('The Evolution of the Heat Equation with Source f(x)=%s', func2str(f)))

2 commentaires
KieranSQ
le 11 Fév 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Tables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!