how can i make the differential of a function handle?
Mostra commenti meno recenti
Hello everybody,
in the following is a snippet from my program i wrote:
%Mein Programm:
syms t;
strp=input('Profil für Pitching:\n','s');
funp=str2func(['@(t)',strp]);
dT=input('delta time:\n');
% Folgende Werte werden nicht geändert:
funpdiff=diff(funp,t);
dT1=dT;
t=1024*dT;
t=double(t);
% Ende
% Pitch-Gradzahl, die gelaufen wird:
dTp1=dT;
kpI1=0;
while funpdiff(dTp1) >= 0
dTp1=dTp1+dT1;
end
Gp=abs(funp(0))+abs(funp(dTp1));
% Ende
It gives me the following errors:
Error using sym>checkindex (line 2429) Index must be a positive integer or logical.
Error in sym>privformatscalar (line 2376) checkindex(x);
Error in sym>privformat (line 2360) s = privformatscalar(x);
Error in sym/subsref (line 1578) [inds{k},refs{k}] = privformat(inds{k});
Error in Motion_To_PVT_Pitching_Soeren (line 25) while funpdiff(dTp1) >= 0
I don't know what they mean with a 'positive integer or logical'. I think the problem is with the differentiation of the function handle but i don't know how to avoid that, i need the differentiation of an input and then the values at certain points (which are also an input (dT,2dT,3dT and so on). And at the end also an integral of the differentiation which should be working then.
while funpdiff(dT) >= 0
p1=integral(funpdiff1,dT-dT1,dT)*Dp_M1;
v1=funpdiff1(dT);
p2=integral(funpdiff2,dT-dT1,dT)*Dp_M2;
v2=funpdiff2(dT);
p1=double(p1);
v1=double(v1);
p2=double(p2);
v2=double(v2);
fprintf('PVC= %.2f,%.2f,%.2f;\n',p1,v1,t);
fprintf('PVD= %.2f,%.2f,%.2f;\n',p2,v2,t);
dT=dT+dT1;
end
Thank you in advance for any help! I really need it. I am running out of time :(
Sören
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!