How can I choose which data correspond to the X and Y axes using EZPLOT in MATLAB (R2013a)?

1 view (last 30 days)
I would like to plot a function of two variables 'x' and 'y', but would prefer to have control as to which variable corresponds to which axis. For example, I would like to have the Y-data on the horizontal (X) axis. How can I do that?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Oct 2013
EZPLOT plots the variables in string expressions alphabetically. To avoid this ambiguity, you would specify the order using an anonymous function:
>> subplot(1,2,1)
>> ezplot('1./y - log(y) + log(-1+y) + x - 1')
>> subplot(1,2,2),
>> ezplot(@(y,x)1./y - log(y) + log(-1+y) + x - 1)

More Answers (0)

Products


Release

R2013a

Community Treasure Hunt

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

Start Hunting!