using fimplicit with an equation

1 次查看(过去 30 天)
Daniel Hunt
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 CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by