using fimplicit with an equation

2 ビュー (過去 30 日間)
Daniel Hunt
Daniel Hunt 2018 年 2 月 25 日
コメント済み: Daniel Hunt 2018 年 2 月 25 日
I am trying to create a plot of a 3D implicit function given by :
sin(x + y) + sin(x − y) + sin(y + z) + sin(y − z) + sin(x + z) + sin(x − z) = 0.
The code i have tried so far is:
%this is an mfile that explores and plots a given 3D implicit function %using the fimplicit command x=[-1:0.0001:-0.0001,0.0001:0.0001:1]; y=[-1:0.0001:-0.0001,0.0001:0.0001:1]; z=[-1:0.0001:-0.0001,0.0001:0.0001:1]; fimplicit3(sin(x+y)+sin(x-y)+sin(y+z)+sin(y-z)+sin(x+z)+sin(x-z)=0)
This gives me the error code 'the expression on the left of the equals sign is not a valid target for assignment.
Removing the =0 gives me the following string of errors:
Error using nargin Argument must be either a character vector or a function handle.
Error in matlab.graphics.function.ImplicitFunctionSurface>getFunction
Error in matlab.graphics.function.ImplicitFunctionSurface/updateFunction
Error in matlab.graphics.function.ImplicitFunctionSurface/set.Function
Error in matlab.graphics.function.ImplicitFunctionSurface
Error in fimplicit3>singleFimplicit (line 182) hObj = matlab.graphics.function.ImplicitFunctionSurface(fn,extraOpts{:},args{:});
Error in fimplicit3>@(f)singleFimplicit(cax,f,limits,extraOpts,args) (line 146) hObj = cellfun(@(f) singleFimplicit(cax,f,limits,extraOpts,args),fn,'UniformOutput',false);
Error in fimplicit3>vectorizeFimplicit (line 146) hObj = cellfun(@(f) singleFimplicit(cax,f,limits,extraOpts,args),fn,'UniformOutput',false);
Error in fimplicit3 (line 120) hObj = vectorizeFimplicit(cax,fn,limits,extraOpts,args);
Error in fimplicit (line 6) fimplicit3(sin(x+y)+sin(x-y)+sin(y+z)+sin(y-z)+sin(x+z)+sin(x-z))
Any guidance on this command or perhaps a different command i should be using would be much appreciated
  2 件のコメント
Daniel Hunt
Daniel Hunt 2018 年 2 月 25 日
I have also tried using f=@(x,y,z) and then my function and get the same error message as before
Daniel Hunt
Daniel Hunt 2018 年 2 月 25 日
I've worked out what my problem was. All sorted now

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by