The reason you get this error is thatz1 doesn't exist inside the function at the time of the input command.
The only way I can think of to do this is to enter
evalin('base','z1')
after the input prompt.
doc evalin
for details of this function.
Your problem is a bit odd to me, though. If you already know whatz1 is before you call the function, why are you asking the user for it? Why not just pass it as an argument?
Best Answer