i want to write a code where equation is y=x*x. if y=100 what is the value of x?
1 次查看(过去 30 天)
显示 更早的评论
i have written
z=100;
for x=1:1:20
y=x*x
if y==z
fprintf(x)
end
end
0 个评论
采纳的回答
Stephen23
2020-9-18
编辑:Stephen23
2020-9-18
>> f = @(x) x.^2 - 100;
>> x = fzero(f,pi)
x = 10
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!