|
Hi,
Thanks for the reply. I think i didnt make it clear in my question. I have one more fucntion myfunc where i am using the parameter T and alpha. By passing it through the handle, the error i am getting is "T not defined"
% FileName Parameter.m
function[T, alpha] = Parameter()
T = 0.000001;
alpha = 0.004;
end
%FileName Top.m
fhandle = @Parameter
Q = myfunc(fhandle)
% FileName myfunc.m
function[X] = myfunc(T, alpha)
X = T/alpha ;
end
Thanks,
Rajeev
"Rajeev Narayanan" <rite2rajeev@gmail.com> wrote in message <hcs617$2d9$1@fred.mathworks.com>...
> Hi,
>
> I have created the following function and need to be passed as a function handle and i am getting some errors. The parameters T and alpha are not visible in my Top.m. Can someone help me out?
>
> % FileName Parameter.m
> function[T, alpha] = Parameter()
> T = 0.000001;
> alpha = 0.004;
> end
>
> %FileName Top.m
>
> fhandle = @Parameter
> Q = myfunc(fhandle)
>
> Thanks,
> Rajeev
|