How to use subtitution in solving equation ??

i have an equation like this
total = volume * barrel
using subs( total, {volume, barrel}, {3, 4}) i can solve for total
but if i have total and volume , how can i solve for barrel ?

Answers (2)

doc solve

1 Comment

hai
hai on 4 Jan 2013
Edited: hai on 4 Jan 2013
solve( total, barrel ), then we have function barrel = total / volume , then we use subs(new_function,{total, volume}, {12,4}) . Is this what you mean) ?

Sign in to comment.

hai
hai on 4 Jan 2013
i mean if i have the total is 12 , and the volume is 4 , then i must solve that the we have 3 barrel, how we can do that in matlab ?

2 Comments

Personally, I would use fzero()
t = 12;
v=4;
fzero(@(b)v*b-t,pi)
it work ,but i don't want to change the equation at all, i want to keep t = v*b .

Sign in to comment.

Asked:

hai
on 4 Jan 2013

Community Treasure Hunt

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

Start Hunting!