Plotting an inequality of two related variable in a linear space

I want to plot the inequality with two variables a and b such that a>b. Variables a and b have values between 0 and 1. Inequality I want to plot is - 8*a^6+3*(a^3)(b^2)+sqrt(2*(a^5)(b)+7*(a^2)(b^4))>=a^3/b^2. I want the shaded region where inequality is satisfied. How can I plot this in matlab? I am new to graphing and any sort of help will be really appreciated.

 Accepted Answer

Try
f = @(a,b)a^3/b^2-(- 8*a^6+3*(a^3)(b^2)+sqrt(2*(a^5)(b)+7*(a^2)(b^4)));
fimplicit(f,[0 1 0 1])
I didn't use it until now, but maybe
is also an option.

6 Comments

But how will I make sure a>b in this?
I tried this and I got an empty plot Why is that?
What about
f = @(a,b)a^3-b^2*(- 8*a^6+3*(a^3)(b^2)+sqrt(2*(a^5)(b)+7*(a^2)(b^4)));
?
If the plot is again empty, then the expression is either always > 0 or < 0 for values in [0:1]x[0,1] .
Still getting an empty graph with a warning. Warning: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments.
f = @(a,b)a.^3./b.^2-(- 8*a.^6+3*(a.^3).*(b.^2)+sqrt(2*(a.^5).*b+7*(a.^2).*(b.^4)));
I think you also forgot several multiplication signs in your function definition.
I figured my mistake. It worked! Thanks a ton

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2022a

Tags

Community Treasure Hunt

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

Start Hunting!