How to Fix undefined function "createpde" - matlab

I run a program about partial differential equation in MATLAB, so I used
model = createpde();
But there's an error:
Undefined function 'createpde' for input arguments of type 'double'.
I tried to search the solution and based on another forum, I should use which createpd -all to determine the path of the function. But when I tried to used that command, I got this error:
createpde not found
So how can I fix this error?

Related

Error when calling function: Undefined function or variable 'gscale'

I have following code in MATLAB for image processing:
f=imread('oooo.png');
F=fft2(f);
S=fftshift(log(1+abs(F)));
S=gscale(S);
imshow(S)
but MATLAB gives me an error,
Undefined function or variable 'gscale'.
Does anyone know why this is, and how I can fix it?

Error while using Matlab logical operators and tables

I am trying to use a very simple logical argument using the following code:
for i=1:size(A)
if A.VariableName(i)==0
flag=1;
break
end
end
however I get the following error:
Undefined operator '==' for input arguments of type 'cell'.
Any ideas on how to overcome this strange issue?

xlsread error - Undefined function 'biffread' for input arguments of type 'char'

For one of my Matlab routines, I receive the following error message when reading an xls file with Matlab 2012b:
Undefined function 'biffread' for input arguments of type 'char'. Error in xlsread (line 71). biffvector = biffread(filename);
The relevant line of code reads as follows:
[a,b] = xlsread('sheet.xls','sheetName')
When I modify the code as follows:
[a,b,c] = xlsread('sheet.xls','sheetName')
I receive another error message:
Error using xlsread. Too many output arguments.
The puzzling part is that exactly the same lines of code work fine in another Matlab code of mine (apparently the problem is not related to the xls-file).
Can anyone explain this to me and how I can possibly solve this problem?

not able to define function in matlab showing error

I defined the following function in matlab:
function draw_snake(snake,food)
but matlab shows me an error message saying:
Error: Function definitions are not permitted in this context.
I am new to matlab and just installed it.
I am using MATLAB version 8.1.0.604.
See here
The docs say
"function [y1,...,yN] = myfun(x1,...,xM) declares a function named
myfun that accepts inputs x1,...,xM and returns outputs y1,...,yN.
This declaration statement must be the first executable line of the
function."
So,
function draw_snake(snake,food)
must be the first line in a script called draw_snake.m

Undefined function or variable 'optimoptions' in Matlab

I use this from the documentation:
options = optimoptions('fminunc','GradObj','on','Hessian','on');
and for some reason I get this error:
Undefined function 'optimoptions' for input arguments of type 'char'.
I am not sure what is the problem. Also when I type optimoptions in Matlab
it says:
Undefined function or variable 'optimoptions'.
Thanks
The function optimoptions was newly introduced in MATLAB R2013a. It might be the case that you are using an older version of MATLAB. If so use optimset instead of optimoptions.