How to use find() to find unique values in equations?

Assume I have the following surfaces:
z1 = x + y and z2 = 2x + y
How can I use the find() function to find unique values of z for each equation given the same x and y values. By unique I mean values of z1 or z2 that are unique to each respective equation. For example, x and y = 0 would both give the same value for z1 and z2. That's what not what I care about. What I care about is knowing x and y values where z1 and z2 are both different.
I'm new to this so I might need a bit of a step-by-step explanation.
Thank you

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 3 月 30 日

0 投票

Example
x=10;
y=20
z1 = x + y
z2 = 2x + y
idx=z1==z2 % if idx is equal to 0, that means z1 and z2 are different

4 件のコメント

A
A 2014 年 3 月 31 日
Thanks!
But how can find out the values of x and y where z is different?
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 3 月 31 日
What are the values of x and y?
A
A 2014 年 3 月 31 日
Assume they have a range from -10 to 10.
Thank you
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 3 月 31 日
From your equations, z1 and a2 are equals if x+y is equal to 2*x+y, which means 2x=x, no matter what y is.
you don't need Matlab to resolve this, the solutions are (0,y), y belong to [-10,10]

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

カテゴリ

ヘルプ センター および File ExchangeNumerical Integration and Differential Equations についてさらに検索

質問済み:

A
A
2014 年 3 月 30 日

コメント済み:

2014 年 3 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by