Solve integral in nested function
hello there,
i am trying to build something like this:
if true
function x = first
x = 5*y
function y = nested
I = @(x) x^2
y = integral(I,0,1)
end
end
end
but there occurs an error stating: ‘Error: Function definitions are not permitted in this context.’
Does anyone know an alternative or sees the misstake i made?
thanks!hello there,
i am trying to build something like this:
if true
function x = first
x = 5*y
function y = nested
I = @(x) x^2
y = integral(I,0,1)
end
end
end
but there occurs an error stating: ‘Error: Function definitions are not permitted in this context.’
Does anyone know an alternative or sees the misstake i made?
thanks! hello there,
i am trying to build something like this:
if true
function x = first
x = 5*y
function y = nested
I = @(x) x^2
y = integral(I,0,1)
end
end
end
but there occurs an error stating: ‘Error: Function definitions are not permitted in this context.’
Does anyone know an alternative or sees the misstake i made?
thanks! integral, nested functions, passing results MATLAB Answers — New Questions