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

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?

Related

How to Fix undefined function "createpde"

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?

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?

Strange error in using matlab program ==> Too many input argument

We have very strange error that I don't know why:
This code run with my laptop and is correct but It doesn't work with another
laptop(has the same matlab version) with this error TOO MANY INPUT ARGUMENT
In Line 10!
clear
syms b c d;
E=29000; I=240/144;
mab=2*E*I*(b)/18;
mba=2*E*I*(2*b)/18;
mbc=2*E*I*(2*b+c)/12-24;
mcb=2*E*I*(b+2*c)/12+24;
mbd=2*E*I*(2*b+d-3*.6/144)/12;
mdb=2*E*I*(b+2*d-3*.6/144)/12;
[tetb tetc tetd]=solve(mcb==0,mba+mbc+mbd==0,mdb==0,b,c,d)
c=tetc;
b=tetb;
d=tetd;
eval(mab)
Use which solve to check which function is called. Since they differ in your case (see comments), you can use the method given for this question to exactly specify the path for a function to use. See addpath and rmpath there.

Matlab error "Find requires variable sizing"

[~,col] = find(ocpRefPt(2,:)>x1 & ocpRefPt(2,:)<x2 & ocpRefPt(1,:)>y1 & ocpRefPt(1,:)<y2);
About is the line where the compilation fails. The above line is in a loop.
x1,x2,x3,x4 are scalars(natural numbers)
ocpRefPt is a 2x16 matrix
Error: FIND requires variable sizing
What does this mean. How to overcome this error?
So it seems that you are trying to compile with emlmex to make embedded code. The error is saying that the size of the output of find is not known, and apparently the compiler requires fixed size outputs. See this newsgroup post for one explanation.
This method of compilation seems to be obsolete -- use the MATLAB coder (codegen command) instead:
emlmex Generate a C-MEX file from MATLAB code.
emlmex [-options] fun1 [fun2 ...]
This function is obsolete. For general purpose acceleration
and code generation use CODEGEN.

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