MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Scilab:“第一个和第二个输入参数必须在函数histplot的第53行是实数” (https://www.labfans.com/bbs/showthread.php?t=24087)

poster 2019-12-10 20:48

Scilab:“第一个和第二个输入参数必须在函数histplot的第53行是实数”
 
为什么这段代码在Scilab中失败?

N=1000; U=rand(N, 1); X=(9*U - 1)^(1/3); histplot(200, X);

[B]回答:[/B]

由于X不是实数,代码很可能失败。如果U小于1/9 ,则可能发生这种情况,这意味着您将负数取三阶根。

通过检查X中的值是否为实,可以找到U的有问题的值。



[url=https://stackoverflow.com/questions/4114196]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:26

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.