Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
question in solve

Subject: question in solve

From: mahdi roozbhani

Date: 29 Dec, 2010 10:20:05

Message: 1 of 4

in the below code, how can I put number instead of slope?

for example, I want to obtain the amount of equation for slope equal to 1.

>> solvi=solve('(x-1)^2+(y-1)^2=4','y-slope*x=0');
solvi=[solvi.x,solvi.y];
solvi(1)
 
ans =
 
(slope + slope*(3*slope^2 + 2*slope + 3)^(1/2) + slope^2)/(slope*(slope^2 + 1))

Subject: question in solve

From: Walter Roberson

Date: 29 Dec, 2010 10:31:55

Message: 2 of 4

On 29/12/10 4:20 AM, mahdi roozbhani wrote:
> in the below code, how can I put number instead of slope?
>
> for example, I want to obtain the amount of equation for slope equal to 1.
>
>>> solvi=solve('(x-1)^2+(y-1)^2=4','y-slope*x=0');
> solvi=[solvi.x,solvi.y];
> solvi(1)
>
> ans =
>
> (slope + slope*(3*slope^2 + 2*slope + 3)^(1/2) +
> slope^2)/(slope*(slope^2 + 1))

subs(solvi,'slope',1)

Subject: question in solve

From: mahdi roozbhani

Date: 29 Dec, 2010 13:05:05

Message: 3 of 4

thanks walter for your help.

Subject: question in solve

From: mahdi roozbhani

Date: 30 Dec, 2010 03:27:05

Message: 4 of 4

How can I put variables in the solve syntax?

x10=1;
y10=1;
z10=1;
x20=1.5;
y20=1.5;


zn=solve('x20-x10)^2+(y20-y10)^2+(zn-z10)^2=4');

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us