User request within a function
显示 更早的评论
Hello,
I am using a function to solve a coupled differential equation.
function [vec] = ode45func(x,z)
k = input('Value for k: ');
vec=[
z(1);
-4*z(1)-0.1*z(2)+k*(z(3)-z(1));
z(3);
-4*z(3)-0.1*z(4)+k*(z(1)-z(3))
];
end
As you can see, I try to get an user input when I call the function, to give k a value.
But I only get a loop of the input request. It just asks again and again for user input...
Any Ideas? Thank you
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!