Matrix as input argument of a matlab function
Ältere Kommentare anzeigen
I want to pass two matrices A and B as input arguments to a function. but I am getting the error "Not enough input argument" I tried a simple function as follows but still I am getting the same error,
function [ C ] = add( A, B )
%ADD TWO MATRICES A AND B
C=A+B;
end
Akzeptierte Antwort
Weitere Antworten (2)
James Tursa
am 17 Jun. 2013
How are you calling the function? E.g., are you doing this:
A = rand(2,2); % sample data
B = rand(2,2); % sample data
C = add(A,B);
1 Kommentar
Bijoy
am 17 Jun. 2013
Roger Stafford
am 17 Jun. 2013
0 Stimmen
Check that you don't have another function named 'add' on your system that calls for more than two inputs and is being mistakenly called instead of your current 'add' function.
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!