anss是主程序,其他两个是子程序,都放在一个文件夹里了,而且目录也是那个文件夹
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/06/14 00:43:36
anss是主程序,其他两个是子程序,都放在一个文件夹里了,而且目录也是那个文件夹
为什么就是有错误呢?
-----------------------------------------------------------------------
anss.m
---------------------------------------------------------------------------
biglength =100;
bigwidth = 50;
siz = 1;
a1=5;
a2=0;
% b b
% a b c
% a b a b
amount1 = circleone(a1);
amount2 = circletwo(a1,biglength,bigwidth);
amount3 = circletwo(a1,bigwidth,biglength);
amount =max([amount1 amount2 amount3])
------------------------------------------------------------------------
circleone.m
---------------------------------------------------------------------
function circleone(r)
x=fix(biglength/2/r);
y=fix(bigwidth/2/r);
sonamount = x*y;
if (biglength-x*2*r)>0.73*r
sonamount=sonamount+y-1;
end
if ((bigwidth-y*2*r)>(0.73*r))
sonamount=sonamount+x-1;
end
if (((biglength-x*2*r)>0.73*r)&((bigwidth-y*2*r)>r))||(((bigwidth-y*2*r)>0.73*r)&((biglength-x*2*r)>r))
sonamount=sonamount+1;
end
circle=sonamount;
end
-----------------------------------------------------------------------
function circletwo(r,a,b)
% 之前(r,x,y)或者(r,y,x)来更改顺序
x=fix(a/2/r);
if ((a/2/r-x)>r)
y=fix((b-2*r)/1.73/r)+1;
sonamount=x*y;
else
y=fix((b-2*r)/1.73/r)+1;
if (y/2 -fix(y/2))0
sonamount=(y-1)*(2*x-1)/2+x;
else
sonamount=(2*x-1)*y/2;
end
end
circletwo=sonamount;
end
------------------------------------------------------------------------
为什么就是有错误呢?
-----------------------------------------------------------------------
anss.m
---------------------------------------------------------------------------
biglength =100;
bigwidth = 50;
siz = 1;
a1=5;
a2=0;
% b b
% a b c
% a b a b
amount1 = circleone(a1);
amount2 = circletwo(a1,biglength,bigwidth);
amount3 = circletwo(a1,bigwidth,biglength);
amount =max([amount1 amount2 amount3])
------------------------------------------------------------------------
circleone.m
---------------------------------------------------------------------
function circleone(r)
x=fix(biglength/2/r);
y=fix(bigwidth/2/r);
sonamount = x*y;
if (biglength-x*2*r)>0.73*r
sonamount=sonamount+y-1;
end
if ((bigwidth-y*2*r)>(0.73*r))
sonamount=sonamount+x-1;
end
if (((biglength-x*2*r)>0.73*r)&((bigwidth-y*2*r)>r))||(((bigwidth-y*2*r)>0.73*r)&((biglength-x*2*r)>r))
sonamount=sonamount+1;
end
circle=sonamount;
end
-----------------------------------------------------------------------
function circletwo(r,a,b)
% 之前(r,x,y)或者(r,y,x)来更改顺序
x=fix(a/2/r);
if ((a/2/r-x)>r)
y=fix((b-2*r)/1.73/r)+1;
sonamount=x*y;
else
y=fix((b-2*r)/1.73/r)+1;
if (y/2 -fix(y/2))0
sonamount=(y-1)*(2*x-1)/2+x;
else
sonamount=(2*x-1)*y/2;
end
end
circletwo=sonamount;
end
------------------------------------------------------------------------
问题多多啊!circleone中biglength和bigwidth都没赋初值.而且matlab的函数不是这样返回结果的.函数的定义是这样的:function [y1,...,yN] = myfun(x1,...,x)Matlab中帮助中的例子 function y = average(x)
if ~isvector(x)
error('Input must be a vector')
end
y = sum(x)/length(x);
end
if ~isvector(x)
error('Input must be a vector')
end
y = sum(x)/length(x);
end
anss是主程序,其他两个是子程序,都放在一个文件夹里了,而且目录也是那个文件夹
partial是什么意思?是手机里的一个文件夹,
照片命名问题我整理照片的时候,建立了20个文件夹,一个文件夹里面放3张照片,我把每个文件夹里面的3张照片都重新命名,可是
手机里在安卓那个文件夹里的数据包一起的这个文件夹tv.billy goat.crc是什么意思?
金山词霸2009里的生词文件夹是哪个啊?
在E盘里怎么会出现这个文件夹?这个好像是 垃圾箱
三星手机通话录音是保存在那一个文件夹内?
英语翻译原来的那个文件夹我打不开了(如图右边的那个),新增加的那个文件夹里边的文件都不是我们的.
在手机里的audin文件夹是什么意思?
新概念英语2 TXT我要新概念英语2课文的txt,只要txt就好了,最好是每一课都是单独的,然后在一个文件夹里~
英语翻译1.我注意到一部分图纸参考的是xxx(比如xxx) 我在你给我的文件夹里没有找到它,所以我参考了一个早期的版本,
scilab应用程序下了一个SCILAB4.1.2,不知道打开方式.EXE文件在哪啊?下载的是一个压缩文件夹,里面没有运