PLOT COMMAND USING string arguments

5 vues (au cours des 30 derniers jours)
IO2000
IO2000 le 12 Juin 2013
I have the following code if true
x = get(text1,'string');
y = get(text2,'string');
axes(plot1);
plot(x,y);
end
but I got and error :
ERROR using Plot invalid first data argument| | the string on text1 is -10:10 and the string in text2 is x.^2
What is wrong?

Réponse acceptée

Kye Taylor
Kye Taylor le 12 Juin 2013
Modifié(e) : Kye Taylor le 12 Juin 2013
Maybe try
x = eval(get(text1,'string'));
y = eval(get(text2,'string'));
axes(plot1);
plot(x,y);
  1 commentaire
IO2000
IO2000 le 12 Juin 2013
thanks it works

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by