24小时热门版块排行榜    

查看: 1040  |  回复: 7
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

benladen

木虫 (小有名气)

[求助] matlab程序运行报错求助 已有2人参与

m文件如下,运行报错,求调试
其子函数程序为:
function[s,v,a]=Zihanshu(theta1)
global LBC XD
theta3=atan(0.075*sin(theta1)./(0.075*cos(theta1)+0.15));
delta_theta1=atan(0.075*sin(theta1+2*pi*10^(-6))./(0.075*cos(theta1+2*pi*10^(-6))+0.
15));
delta_theta2=atan(75*sin(theta1+4*pi*10^(-6))./(75*cos(theta1+4*pi*10^(-6))+150));
s=sqrt((LBC)^2-(XD-0.23+0.15+0.1*cos(theta3)).^2)-0.1*sin(theta3);
s1=sqrt((LBC)^2-(XD-0.23+0.15+0.1*cos(delta_theta1)).^2)-0.1*sin(delta_theta1);
v=-((s1-s)/10^(-6));
s2=sqrt((LBC)^2-(XD-0.23+0.15+0.1*cos(delta_theta2)).^2)-0.1*sin(delta_theta2);
a=-(((s2-s1)/10^(-6)-(s1-s)/10^(-6))/10^(-6));
带入主函数程序:
global LBC XD
LBC=0.100;
XD=-0.150;
[s,v,a]=Zihanshu(4/3*pi:2*pi/36:10/3*pi);
theta1=4/3*pi:2*pi/36:10/3*pi;
subplot(1,3,1)
plot(theta1,-s,'-b');
title('Image of displacement of cutting tool');
ylabel('value of function')
grid on;
subplot(1,3,2)
plot(theta1,v,'-k');
title('Image of speed of cutting tool');
xlabel('theta');
grid on;
subplot(1,3,3)
plot(theta1,a,'-m');
title('Image of acceleration of cutting tool');
grid on;
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

benladen

木虫 (小有名气)

引用回帖:
4楼: Originally posted by 炎海飞雪 at 2014-05-15 15:11:35
程序没有什么错误。把这一句“delta_theta1=atan(0.075*sin(theta1+2*pi*10^(-6))./(0.075*cos(theta1+2*pi*10^(-6))+0. 15));”写到一行就可以了

按照你说的改了之后,在editer中直接运行M文件提示如下错误
??? Input argument "theta1" is undefined.

Error in ==> Zihanshu at 3
theta3=atan(0.075*sin(theta1)./(0.075*cos(theta1)+0.15));
这是怎么回事啊?
5楼2014-05-15 17:56:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 8 个回答

benladen

木虫 (小有名气)

主程序怎么调用子程序啊,这个就是传参数时出错了
完全新手,谢谢指导
2楼2014-05-14 21:34:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

gyq274706322

银虫 (正式写手)

【答案】应助回帖

★ ★
感谢参与,应助指数 +1
benladen: 金币+2, 有帮助 2014-05-15 21:05:57
最好把出错的信息贴出来
3楼2014-05-15 07:37:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

炎海飞雪

木虫 (正式写手)

【答案】应助回帖

感谢参与,应助指数 +1
程序没有什么错误。把这一句“delta_theta1=atan(0.075*sin(theta1+2*pi*10^(-6))./(0.075*cos(theta1+2*pi*10^(-6))+0. 15));”写到一行就可以了
4楼2014-05-15 15:11:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 294求调剂材料与化工专硕 +11 陌の森林 2026-03-18 11/550 2026-03-19 13:22 by houyaoxu
[考研] 一志愿天大材料与化工(085600)总分338 +5 蔡大美女 2026-03-13 5/250 2026-03-19 10:44 by 是小刘呀~
[考研] 0703化学调剂,求各位老师收留 +10 秋有木北 2026-03-14 10/500 2026-03-19 05:52 by anny19840123
[考研] 26调剂/材料/英一数二/总分289/已过A区线 +7 步川酷紫123 2026-03-13 7/350 2026-03-18 17:12 by 尽舜尧1
[考研] 材料与化工一志愿南昌大学327求调剂推荐 +8 Ncdx123456 2026-03-13 9/450 2026-03-18 14:40 by haxia
[考研] 0703化学调剂 ,六级已过,有科研经历 +10 曦熙兮 2026-03-15 10/500 2026-03-18 14:19 by 007_lilei
[考研] 302求调剂 +10 呼呼呼。。。。 2026-03-17 10/500 2026-03-18 12:45 by Linda Hu
[考研] 265求调剂 +3 梁梁校校 2026-03-17 3/150 2026-03-18 09:12 by zhukairuo
[基金申请] 被我言中:新模板不强调格式了,假专家开始管格式了 +4 beefly 2026-03-14 4/200 2026-03-17 22:04 by 黄鸟于飞Chao
[考研] 326求调剂 +5 上岸的小葡 2026-03-15 6/300 2026-03-17 17:26 by ruiyingmiao
[考研] 274求调剂 +5 时间点 2026-03-13 5/250 2026-03-17 07:34 by 热情沙漠
[考研] 070303 总分349求调剂 +3 LJY9966 2026-03-15 5/250 2026-03-16 14:24 by xwxstudy
[考研] 085601材料工程315分求调剂 +3 yang_0104 2026-03-15 3/150 2026-03-15 10:58 by peike
[考研] 材料与化工 323 英一+数二+物化,一志愿:哈工大 本人本科双一流 +4 自由的_飞翔 2026-03-13 5/250 2026-03-14 19:39 by hmn_wj
[考研] 297求调剂 +4 学海漂泊 2026-03-13 4/200 2026-03-14 11:51 by 热情沙漠
[考研] 材料与化工求调剂一志愿 985 总分 295 +8 dream…… 2026-03-12 8/400 2026-03-13 22:17 by 星空星月
[考研] 材料工程调剂 +9 咪咪空空 2026-03-12 9/450 2026-03-13 22:05 by 星空星月
[考研] 329求调剂 +3 miaodesi 2026-03-12 4/200 2026-03-13 20:53 by 18595523086
[考研] 26调剂/材料科学与工程/总分295/求收留 +9 2026调剂侠 2026-03-12 9/450 2026-03-13 20:46 by 18595523086
[考研] 290求调剂 +3 ADT 2026-03-13 3/150 2026-03-13 10:19 by peike
信息提示
请填处理意见