Differential Equation In Matlab
In this three dimensional plot has different color ribbon, in order to create 3d plot for given function.
Let x^3-y^3
[x,y] = peaks(20);
z =[(x.^3)-(y.^3)];
ribbon(z);
title(‘\bf Ribbon Plot’)
Syntax for the contour plot is
Contour3(x,y,z)
Contour3(z)
Let us consider a function to plot the contour plot
[x,y] = peaks(40);
z = exp(-x.^2-y.^2);
contour3(x,y,z);
title(‘\bf Contour Plot’)
In order to plot a slice 3d plot we have to know the volumetric data (v) and three dimension coordinates specifications i.e., x,y,z
When you writing a matlab for slice plot when compared with normal 3d plot there will be quite difference between them. i.e., you need to specify each coordinate value. Syntax of slice 3d plot is
slice(x,y,z,v,xslice,yslice,zslice)
slice(v,xslice,yslice,zslice)
Now let us draw a slice for given mathematic equation.
[x,y,z] = meshgrid(-12:.1:12);
v = [exp((x.^2)-(y.^2)-(z.^3))];
xslice = 0.1;
yslice = 5;
zslice = 0;
slice(x,y,z,v,xslice,yslice,zslice)
colorbar
title(‘\bf Slice Plot’)
Now let solve the differential equation in matlab by considering a simple command diff and pass the functions to solve the equations.
Let’s consider the function f(x)=4x2+3x-2
syms x
f = 4*x^2 + 3*x^(-2);
diff(f)
ans=8*x – 6/x^3
Some rules should be followed while solving differential equation, we can write f'(x) for a first order derivative and f”(x) for a second order derivative.
Introduction: When your Hisense TV won't connect to WiFi, it is rarely a problem with…
Hisense Google TV Storage Space Running Out: Why it Happens and How to Fix It…
Introduction: "Setting up a soundbar with your Samsung TV should be simple, but the HDMI…
User Problem Scenario: The Red Light "Panic" You press the power button on your Samsung…
Introduction: I Know the Feeling "We’ve all been there. You sit down to watch your…
User Problem Scenario: The "Diagnosis Loop" Paradox Imagine you notice your apps are slow. You…