Hei , I have this function
function [lambda, lambdap,phip] = Palaeomagfun(I ,D,lambda,lambdax,phix )lambda=atand(tand(I)/2) %in degree
lambdap=asind(sind(lambdax)*sind(lambda)+cosd(lambdax)*cosd(lambda)*cosd(D))if sind(lambda)>=sind(lambdap)*sind(lambdax) phip=phix+asind(cosd(lambda)*sin(D)/cosd(lambdap))elseif sind(lambda)<sind(lambdap)*sind(lambdax) phip=phix+asind(cosd(lambda)*sind(D)/cosd(lambdap))-180end
and this script
Problem 2:
I=30lambdax=47phix=20D=80[lambda, lambdap,phip] = Palaeomagfun(I ,D,lambda,lambdax,phix )
*first,Is it possible to use lambda as an output and input at the same time or i need two function or something else?
second: is my if coding correct in the function?*
Best Answer