Problème exécution fonction
Bonjour,
J'ai un problème d'exécution d'une fonction toute simple. Matlab m'affiche le message d'erreur suivant:
Code:
1 2 3 4
| ??? Undefined function or method 'Local2Global' for input arguments of type 'double'.
Error in ==> New_modelisation at 15
A=Local2Global(Mat_local, Mat_global, indice_local); |
Ma fonction Local2Global est la suivante:
Code:
1 2 3 4 5 6 7 8 9 10
| function [Mat_global2] = Local2Glogal(Mat_local,Mat_global,indice_local)
Mat_global2=zeros(6);
for i=1:length(Mat_local(1,:))
for j=1:length(Mat_global(:,1))
Mat_global2(indice_local(j),indice_local(i))=Mat_local(j,i)+Mat_global(indice_local(j),indice_local(i));
end
end
Mat_local
Mat_global
end |
Et mon main :
Code:
1 2 3 4 5 6 7
| Mat_local=magic(3);
Mat_global=ones(6);
indice_local=[6,4,2];
addpath('C:\Documents and Settings\simulga\Mes documents\MATLAB\New')
A=Local2Global(Mat_local, Mat_global, indice_local); |
Dans la FAQ il était indiqué de donner l'emplacement de la fonction par addpath mais ça ne marche pas plus. j'ai également fait file>setPath comme indiqué dans la FAQ.
Avez vous une solution à mon problème?
Merci d'avance