![]() |
simulink 的一个问题
为什么embedded matlab block中不能出现rand函数,如果要实现下面代码的输出怎么办
switch pp case 1 A=zeros(m0); case 2 A=ones(m0); for i=1:m0 A(i,i)=0; end case 3 for i=1:m0 for j=i+1:m0 p1=rand(1,1); if p1>0.5 A(i,j)=1;A(j,i)=1; end end end otherwise disp('输入参数pp不合法'); return; end 输出A,输入参数m0,pp两个,要求用模块实现。 |
回复: simulink 的一个问题
应该可以得 如果你的版本不能用 那么可以把rand也作为一个输入
|
所有时间均为北京时间。现在的时间是 03:25。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.