PLOT COMMAND USING string arguments

조회 수: 5 (최근 30일)
IO2000
IO2000 2013년 6월 12일
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?

채택된 답변

Kye Taylor
Kye Taylor 2013년 6월 12일
편집: Kye Taylor 2013년 6월 12일
Maybe try
x = eval(get(text1,'string'));
y = eval(get(text2,'string'));
axes(plot1);
plot(x,y);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by