Search code examples
matlabareacurves

Hatching area between two symbolic curves matlab


I need to shade the area between symbolic curves and the x axis.

syms x

j(1) = x^2
j(2) = x^3
j(3) = x^5
j(4) = x^6

for i = 1:4
    subplot(2,2,i);
    f(i) = ezplot(j(i),[0,6000]);
    Hatch(f(i))
end

This gives me an error. After looking in the matlab documentation, i end up with codes like

f1 := plot::Function2d(sqrt(x), x = 0..2, Color = RGB::Black):

Is this even matlab code? What's with the "::" and ":="? Why does this throw an error? Thanks for any help guys!

Thanks!


Solution

  • Write you command under mupad and after to call it with Matlab command window have a look to this : MatLab and MuPad

    For more information go here