How ı can write this function on Matlab
1 次查看(过去 30 天)
显示 更早的评论
I will enter an x value
0 个评论
采纳的回答
Sulaymon Eshkabilov
2020-6-4
Hi,
Here is one of the possible solutions for x having a single value:
function Y = MY_fun(x)
if x>=1 && x<10
Y = exp(-x-1)/(log10(x)+log(x));
elseif x>=10
Y=sin(3*x)/sqrt(3*pi);
else
Y = x^(-exp(1)+x)+sqrt(x)*abs(x);
end
end
13 个评论
Sulaymon Eshkabilov
2020-6-5
Your code had a few potential errs which are not MATLAB version problem.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!