早教吧 育儿知识 作业答案 考试题库 百科 知识分享

w=0:0.0001:6;c=0.1;ifw1x1=pi+atan((2*c.*w)./(1-w.^2));endplot(w,x1)提示Errorusing==>plotVectorsmustbethesamelengths.Errorin==>Untitled3at8plot(w,x1)

题目详情
w=0:0.0001:6; c=0.1; if w<=1 x1=atan((2*c.*w)./(1-w.^2)); elseif w>1 x1=pi+atan((2*c.*w)./(1-w.^2));
end
plot(w,x1)
提示 Error using ==> plot
Vectors must be the same lengths.
Error in ==> Untitled3 at 8
plot(w,x1)
▼优质解答
答案和解析
w=0:0.0001:6;
c=0.1;
x1=(w<=1)*atan((2*c.*w)./(1-w.^2))+( w>1)*(pi+atan((2*c.*w)./(1-w.^2)))