using fimplicit with an equation

1 Ansicht (letzte 30 Tage)
Daniel Hunt
Daniel Hunt am 25 Feb. 2018
Kommentiert: Daniel Hunt am 25 Feb. 2018
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 Kommentare
Daniel Hunt
Daniel Hunt am 25 Feb. 2018
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 am 25 Feb. 2018
I've worked out what my problem was. All sorted now

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by