Potentially easy matlab question here, but I've searched and can't sort out how to do this.
I've got a variables, which plot like this:
I simple want the x axis to be the y axis and vice versa. How do I swap them?
Thank you in advance for your help!!
In computer programming, the exclusive or swap (sometimes shortened to XOR swap) is an algorithm that uses the exclusive or bitwise operation to swap the values of two variables without using the temporary variable which is normally required.
Swaps Summary For example, a company paying a variable rate of interest may swap its interest payments with another company that will then pay the first company a fixed rate. Swaps can also be used to exchange other kinds of value or risk like the potential for a credit default in a bond.
The swap() method of java. util. Collections class is used to swap the elements at the specified positions in the specified list. If the specified positions are equal, invoking this method leaves the list unchanged.
The standard way would be to swap the arguments passed to plot
:
plot(ydata, xdata) %// instead of plot(xdata, ydata)
Failing that, you can change the view to rotate the axes:
view([90 -90]) %// instead of normal view, which is view([0 90])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With