salut tous,
j'ai fais un programme qui fait divers calculs mais qui pour cela a besoin de changer de dossiers plusieurs fois au travers de diverses fonctions.
Je pensais que ce que j'avais fait était correct mais ça ne fonctionne pas, j'ai cette erreur:
??? Undefined function or method 'writeDataFile' for input arguments of type
'double'.
Error in ==> writeFiles at 11
writeDataFile(Gamma1,A1,B1,T6folder,currentFolder);
Error in ==> calculs at 10
writeFiles(gamma_data,A_data,B_data);
Error in ==> methodeInverse at 21
residu=calculs(parametres,RmEXP,FvEXP);
pourtant mon code me parait correct, le voici:
Ma fonction principale (pas de soucis elle appel la fonction calcul):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
close all
clear all
clc
global normalisation;
global count;
count=0;
RmEXP=[4.5e-9 3.5e-9 3e-9 1.25e-9 2.5e-9 1e-9]';
FvEXP=[0.017 0.014 0.0155 0.014 0.00015 0.00001]';
Gamma=0.1;
A=918;
B=64;
parametresInitiaux=[Gamma, A, B];
normalisation=[(1/Gamma) 0 0; 0 (1/A) 0; 0 0 (1/B)];
parametres=parametresInitiaux*normalisation;
residu=calculs(parametres,RmEXP,FvEXP); |
Ma fonction calcul (pas de soucis ):
1 2 3 4 5 6 7 8 9
|
function RESIDU=calculs(parametresI,Rm_exp,Fv_exp)
global normalisation;
global count;
gamma_data=parametresI(1)/normalisation(1,1);
A_data=parametresI(2)/normalisation(2,2);
B_data=parametresI(3)/normalisation(3,3);
writeFiles(gamma_data,A_data,B_data);
RESIDU=0; |
voici où ça pose probleme lorsque j'appel la fonction "writeDataFile":
1 2 3 4 5 6 7 8 9 10
|
function writeFiles(Gamma1,A1,B1)
currentFolder=cd('C:\INVERSE');
T6folder = cd('C:\INVERSE\T6');
T200folder = cd('C:\INVERSE\T200');
T300folder = cd('C:\INVERSE\T300');
T400folder = cd('C:\INVERSE\T400');
T500folder = cd('C:\INVERSE\T500');
T560folder = cd('C:\INVERSE\T560');
writeDataFile(Gamma1,A1,B1,T6folder,currentFolder); |
et voici cette fonction "writeDataFile":
1 2 3 4 5
|
function writeDataFile(Gamma,A,B,workingFolder,previousFolder)
cd(workingFolder); %je me deplace dans le dossier ou je vais faire des calculs
%ici je fais les calculs, et voici la derniere ligne de la fonction:
cd(previousFolder); |
pouvez vous me dire quel est le soucis avec ma fonction ?
Partager