如何做网站展示商品,站长工具收录,怎么可以上传自己做的网站,怎么在wordpress上添加视频该楼层疑似违规已被系统折叠 隐藏此楼查看此楼上了MATLAB#xff0c;可是对数学完全不感兴趣。老师弄了个作业#xff0c;代码附件了。求大佬帮忙理解原理后简单做一个不一样的过程的程序。帮忙注释一下代码。(一开始忘记下载要币了。不好意思)两个.m文件#xff0c;需要放一…该楼层疑似违规已被系统折叠 隐藏此楼查看此楼上了MATLAB可是对数学完全不感兴趣。老师弄了个作业代码附件了。求大佬帮忙理解原理后简单做一个不一样的过程的程序。帮忙注释一下代码。(一开始忘记下载要币了。不好意思)两个.m文件需要放一个路径好像。---------主------------------------%Project1.mn 20;x 0:0.2:n*pi;y sin(x);A [x;y];thta pi/4;rot [cos(thta) -sin(thta);sin(thta) cos(thta)];%R (x.^2y.^2).^(0.5);B rot*A;% x x1*cos(thta) y1*sin(thta); y-x1*sin(thta)y1*cos(thta);% Updated equation is follow% -x1*sin(thta)y1*cos(thta) sin(x1*cos(thta) y1*sin(thta));% the equation of line is y tan(thta) * x;% the solution of root is x k*pi/(cos(thta)sin(thta)*tan(thta));alpha 1/(cos(thta)sin(thta)*tan(thta));p_n 0:n;x_1 alpha*pi*p_n;y_1 tan(thta)*x_1;figure(1);hold on;plot(B(1,:),B(2,:));plot([0 max(x_1)],[0 max(y_1)]);plot(x_1,y_1,*);hold off;%f (x)sin(x/alpha);df (x)cos(x/alpha)/alpha;init_x x_11/4;n_1 length(init_x);solution_x [];for i 1:n_1[xx] mnewton(f,df,init_x(i),1e-5);solution_x [solution_x xx];endsolution_y tan(thta)*solution_x;figure(2);hold on;plot(B(1,:),B(2,:));plot([0 max(x_1)],[0 max(y_1)]);plot(solution_x,solution_y,o);hold off;-------副被调用---------------------%程序2.4--mnewton.mfunction [x,k]mnewton(f,df,x0,ep,N)%用途:用牛顿法求解非线性方程f(x)0%格式:[x,k]mnewton(f,df,x0,ep,N) f和df分别为表示f(x)%及其导数, x0为迭代初值, ep为精度(默认1e-4), N为最大迭代%次数(默认为500), x,k分别返回近似根和迭代次数if nargin5,N500;endif nargin4,ep1e-4;endk0;while kxx0-feval(f,x0)/feval(df,x0);if abs(x-x0)break;endx0x; kk1;end