eval_r()函数的功能就是将括号内的字符串视为语句并运行
和语句 y1=sin(2)
下面举一个它的应用例子:
>> stationx1=1.508;stationy1=6.98;stationx2=8.181;stationy2=6.388;
stationx3=14.85;stationy3=4.69;stationx4=19.95;stationy4=0.4729;
stationx5=16.93;stationy5=-3.726;stationx6=9.699;stationy6=-6.122;
stationx7=1.32;stationy7=-6.985;stationx8=-5.525;stationy8=-6.728;
stationx9=-13.66;stationy9=-5.114;stationx10=-19.98;stationy10=0.2971;
stationx11=-14.93;stationy11=4.658;stationx12=-8.066;stationy12=6.406;
for i=1:12
end
>> stationx,stationy
stationx =
1.5080 8.1810 14.8500 19.9500 16.9300 9.6990 1.3200 -5.5250 -13.6600 -19.9800
-14.9300
stationy =
6.9800 6.3880 4.6900 0.4729 -3.7260 -6.1220 -6.9850 -6.7280 -5.1140 0.2971
4.6580 6.4060
标签:语句,字符,0.2971,stationx,stationy,0.4729,matlab,eval From: https://blog.51cto.com/u_15995687/6132072