24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 1059  |  回复: 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的回帖

gyq274706322

银虫 (正式写手)

【答案】应助回帖

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

benladen

木虫 (小有名气)

主程序怎么调用子程序啊,这个就是传参数时出错了
完全新手,谢谢指导
2楼2014-05-14 21:34:46
已阅   回复此楼   关注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的回帖

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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 275求调剂 +10 Micky11223 2026-03-25 15/750 2026-03-29 13:30 by Micky11223
[考研] 一志愿:西北大学,英一数一408-284分求调剂 +3 12.27 2026-03-27 3/150 2026-03-29 12:53 by 热情沙漠
[考研] 375求调剂 +4 雨夏整夜 2026-03-29 4/200 2026-03-29 12:09 by 无际的草原
[考研] 085600 材料与化工 329分求调剂 +11 Mr. Z 2026-03-25 11/550 2026-03-29 08:14 by 无际的草原
[考研] 一志愿华北电力大学能动专硕,293,求调剂 +3 15537177284 2026-03-23 5/250 2026-03-28 16:11 by xxxsssccc
[考研] 0703本科郑州大学求调剂 +3 nhj_ 2026-03-25 3/150 2026-03-28 13:24 by Iveryant
[考研] 张芳铭-中国农业大学-环境工程专硕-298 +4 手机用户 2026-03-26 4/200 2026-03-28 07:17 by mmm just
[考研] 340求调剂 +5 jhx777 2026-03-27 5/250 2026-03-28 04:18 by fmesaito
[考研] 求调剂 +8 张zz111 2026-03-27 9/450 2026-03-28 03:41 by fmesaito
[考研] 265求调剂 +8 小木虫085600 2026-03-27 8/400 2026-03-27 22:16 by 无际的草原
[考研] 考研化学308分求调剂 +10 你好明天你好 2026-03-23 12/600 2026-03-27 14:43 by shangxh
[考研] 08开头275求调剂 +4 拉谁不重要 2026-03-26 4/200 2026-03-27 14:12 by Delta2012
[考研] 化学308分求调剂 +8 你好明天你好 2026-03-23 9/450 2026-03-27 14:01 by 杨光于青云
[考研] 322求调剂 +4 我真的很想学习 2026-03-23 4/200 2026-03-27 13:51 by 杨杨杨紫
[考研] 一志愿华东理工大学081700,初试分数271 +6 kotoko_ik 2026-03-23 7/350 2026-03-27 12:29 by 惠州彭于晏
[考研] 284求调剂 +11 junqihahaha 2026-03-26 12/600 2026-03-27 04:37 by wxiongid
[考研] 化学调剂一志愿上海交通大学336分-本科上海211 +4 小鱼爱有机 2026-03-25 4/200 2026-03-26 10:19 by aa331100
[考研] 【2026考研调剂】制药工程 284分 求相关专业调剂名额 +4 袁奂奂 2026-03-25 8/400 2026-03-25 14:32 by lbsjt
[考研] 318求调剂 +3 plum李子 2026-03-23 3/150 2026-03-25 09:42 by 雾散后相遇lc
[考研] B区考研调剂 +4 yqdszhdap- 2026-03-22 5/250 2026-03-25 08:51 by baoball
信息提示
请填处理意见