Plot a variable in x-y plane.

3 ビュー (過去 30 日間)
Shashank
Shashank 2016 年 6 月 9 日
コメント済み: Elias Gule 2016 年 6 月 10 日
I have two variables: "z" and "v" which have the following relationship with x and y:
z = x^2 - y^2
v = 2xy
Its basically a transformation of Cartesian coordinates to hyperbolic coordinates. Now I solve a system of differential equations in this new coordinate system and obtain a variable "h" which goes as:
v = h, but h is not constant but a function of z. Essentially I have h and z as arrays of known size.
Question: I can plot h vs z, pretty straightforward. But how do I plot "h" in x-y space? Any help will be appreciated.

回答 (1 件)

Elias Gule
Elias Gule 2016 年 6 月 9 日
Try this: Remember that on the x-y plane, the value of z is zero.
plot3(z,h,zeros(size(h))); % plots h vs z on the x-y plane
  2 件のコメント
Shashank
Shashank 2016 年 6 月 9 日
編集済み: Shashank 2016 年 6 月 9 日
How is the value of "z" zero in x-y plane? "x" is not always equal to "y".
All I need to know is how to plot specific coordinates of (z,v) in x-y plane. I already have a physical understanding of what the plot should look like. Can't find any syntax on MATLAB though. :(
Elias Gule
Elias Gule 2016 年 6 月 10 日
I thought you wanted to plot h vs z on the x-y plane in a 3-dimensional coordinate system; which appears not to be the case. So now, my next assumption is that you want to plot h vs z, in a 2-dimensional coordinate system such that the h-values appear on the y-axis, while the z-values appear on the x-axis. If that's true then the command
plot(z,h);
should work. Unless I'm mistaken, again.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by