필터 지우기
필터 지우기

Plotting with a handle stored in a variable

조회 수: 3 (최근 30일)
Matthew
Matthew 2012년 6월 11일
This may be an obvious question but it is proving exceedingly frustrating for me right now. Is there a way to store a location to be used in the future for plotting as a variable?
For example: plotloc='handles.smallgraph' and then later on after defining x and y: plot(plotloc,x,y)
When I try this I get the error: Error using plot, invalid first data argument.
Thoughts?

답변 (1개)

Tom
Tom 2012년 6월 11일
you don't need to use the apostrophes, or even really the plotloc variable, you can just write
plot(handles.smallgraph,x,y)
That is, assuming handles has been passed into your function.
  댓글 수: 1
Matthew
Matthew 2012년 6월 11일
Thanks for the response. I knew I could do that, it was more a question of simplicity because there are so many plotting possibilities in my program that I was looking for a way to avoid having to write so many conditional statements.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by