1

シンボリック カーブと x 軸の間の領域をシェーディングする必要があります。

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

これは私にエラーを与えます。matlabのドキュメントを見た後、次のようなコードになります

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

これもmatlabコードですか?「::」と「:=」は何ですか? これがエラーをスローするのはなぜですか? 助けてくれてありがとう!

ありがとう!

4

2 に答える 2

2

Matlabコマンドウィンドウで呼び出すコマンドを下mupadと後に書いて、これを見てください:MatLabとMuPad

詳細はこちら

于 2013-10-03T19:41:48.407 に答える
1

f1 := plot::Function2d(sqrt(x), x = 0..2, Color = RGB::Black):は MuPad (Symbolic Math toolbox) 用です。ただし、このツールボックスがなくても、Matlab の を使用してシンボリック関数を評価できますezplot

次の図

ここに画像の説明を入力

によって与えられます(コードを機能させたコメントを参照してください)

f{1} = 'x^2'; % declare as cell array {} of string ''
f{2} = 'x^3';
f{3} = 'x^5';
f{4} = 'x^6';

figure('Color', 'w');
for ii = 1:4                          %do not use i or j in Matlab
    subplot(2,2,ii);
    h(ii) = ezplot(f{ii},[0,6000]);   %the correct way to call ezplot
    x = get(h(ii), 'XData');          %get the x and y data
    y = get(h(ii), 'YData');
    area(x,y,'FaceColor',[.7 0 0]);   %plot the (x,y) area in red
end
于 2013-10-03T21:18:53.720 に答える