Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MATLAB: Too many input arguments?

Status
Not open for further replies.

Ahmed Alaa

Full Member level 5
Joined
Jul 22, 2009
Messages
317
Helped
61
Reputation
136
Reaction score
44
Trophy points
1,318
Location
Egypt
Activity points
2,965
I am using the built in MATLAB function buffer() but received the error message
-> Too Many Input arguments???
Although the number of inputs are correct.

I checked whether I have other m-files named buffer, but I didn't find one. The strange point is that it works on the PC at office, but doesn't work on my laptop although I use the same MATLAB version in both.

What is the problem then?
 

1 - May be the version of Matlab diffres
2- Save as the program and see if the problem fixes
3 - check the function in the Help of your Matlab program at home
 

In my code I use buffer for dividing a data file into payload packets, I used it before om my SAME laptop for speaker recognition project and it was working properly. Now I only try to call buffer from the comand prompt:

>> buffer([1 0 1 1 0 1], 2)

The out put should be the matrix:
[ 1 1 0 ; 0 1 1];

But I receive the error message stated before.
 

has there been a Matlab version change now?

by the way it can be done as,

x = [1 0 1 1 0 1];
y = reshape(x,2,[])

Added after 1 minutes:

for any x such that length(x)/2 is integer


some manipulation can make the above mentioned 'condition/limitation' go away as well
 

    Ahmed Alaa

    Points: 2
    Helpful Answer Positive Rating
That is probably because the MATLAB version issue, ur commands works fine on my machine.

The alternative method from communications_engineer is also good
 

No, It was working fine on my machine too. I think there is a problem like having an m-file named 'buffer' or so that causes this conflict.
 

if your file name is similar to a built-in matlab function, the matlab function will not work, if it works, the results will not be correct.

Added after 26 seconds:

you have identified it correctly
 

There are many functions in the Matlab and if we used the same name in my functions it'd cause the above problem... I also was on the above way and get this message.. I therefore use Hungarian words to name my functions.. :))) T
 

yes Tamas but I don't have a function called buffer.
I'll try using Hungarian words :D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top