matlab中princ,主成分分析matlab源程序代码(最新整理)

《主成分分析matlab源程序代码(最新整理)》由会员分享,可在线阅读,更多相关《主成分分析matlab源程序代码(最新整理)(3页珍藏版)》请在人人文库网上搜索。

1、dataset=263.8621.611442.754680.266575268.7642.072182.617560.182597261.1961.597692.350370.182114248.7082.096092.852790.257724253.3651.694572.94920.189702268.4341.568192.781130.13252258.7412.146532.691110.136469244.1922.021562.226070.298066219.7381.612241.885990.166298244.7021.914772.259450.187569245.。

2、2862.124992.352820.161602251.961.837142.535190.240271251.1641.741672.629610.211887251.8242.001332.626650.211991257.682.148782.656860.203846stdr=std(dataset);%求个变量的标准差n,m=size(dataset);%定义矩阵行列数sddata=dataset./stdr(ones(n,1),:);%将原始数据采集标准化sddata%输出标准化数据p,princ,eigenvalue,t2=princomp(sddata);%调用前三个主成分系。

3、数p3=p(:,1:3);%提取前三个主成分得分系数,通过看行可以看出对应的原始数据的列,每个列在每个主成分的得分p3sc=princ(:,1:3); sce=eigenvalue(1:3);%输出前三个主成分得分系数%提取前三个主成分得分值%输出前三个主成分得分值%提取前三个特征根并转置M=e(ones(m,1),:).0.5;%输出前三个特征根并转置compmat=p3.*M;%利用特征根构造变换矩阵per=100*eigenvalue/sum(eigenvalue);%求出成分载荷矩阵的前三列per%求出各主成分的贡献率cumsum(per);%列出各主成分的累积贡献率figure(1)。

4、pareto(per);%将贡献率绘成直方图t2figure(2)%输出各省与平局距离plot(eigenvalue,r+);%绘制方差贡献散点图hold on%保持图形plot(eigenvalue,g-);%绘制方差贡献ft麓图figure(3)%关闭图形plot(princ(:,1),princ(:,2),+);%绘制 2 维成份散点图%gname%,(rowname)%标示个别散点代表的省 data 市st2,index=sort(t2);%st2=flipud(st2);%index=flipud(index);%extreme=index(1);“”“”At the end, Xi。

5、ao Bian gives you a passage. Minand once said, people who learn to learn are very happy people. In every wonderful life, learning is an eternal theme. As a professional clerical and teaching position, I understand the importance of continuous learning, life is diligent, nothing can be gained, only c。

6、ontinuous learning can achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank you。

CAD重叠文字避让程序是用于在CAD软件处理文字重叠问题的程序。文字重叠是指在绘图过程,文字之间或文字与其他图形之间重叠在一起,影响了设计的可读性和美观度。为了解决这个问题,可以使用LISP语言编写程序进行处理。 LISP(List Processing)是一种编程语言,特别适用于CAD软件的自定义开发。下面是一个简单的LISP源代码示例,用于实现CAD的文字重叠避让功能: ```lisp (defun c:AvoidOverlappingText ( / obj1 obj2 dist ) (setq obj1 (entsel "\n选择第一个文字:")) (setq obj2 (entsel "\n选择第二个文字:")) (setq dist (getreal "\n请输入避让距离:")) (setq text1 (vlax-ename->vla-object (car obj1))) (setq text2 (vlax-ename->vla-object (car obj2))) (setq pt1 (vlax-get-property text1 'InsertionPoint)) (setq pt2 (vlax-get-property text2 'InsertionPoint)) (setq angle (vla-get-Rotation text1)) (setq vector (vla-get-OrthogonalVector text1)) (setq vector (vlax-curve-getClosestPointTo (vlax-ename->vla-object (car obj2)) pt1)) (setq vector (vla-get-EndPoint (vlax-curve-getClosestPointTo (vlax-ename->vla-object (car obj2)) pt1))) (setq vector (vlax-curve-getClosestPointTo (vlax-ename->vla-object (car obj1)) pt2)) (setq vector (vla-get-EndPoint (vlax-curve-getClosestPointTo (vlax-ename->vla-object (car obj1)) pt2))) (setq vector (vla-get-scalefactor (vla-get-attributes text1))) (setq vector (vla-get-textHeight text1)) (if (and (< (distance pt1 pt2) dist) (< (vla-get-textHeight text1) (vla-get-textHeight text2))) (progn (setq newpt (polar pt2 angle (+ dist (vla-get-textHeight text2)))) (vlax-put-property text1 'InsertionPoint newpt) (prompt "\n文字已避离成功!") ) (progn (prompt "\n文字无法避让!") ) ) (princ) ) ``` 这个LISP程序的基本思路是通过用户选择两个文字对象,然后计算它们之间的距离,并与用户输入的避让距离进行比较。如果距离小于避让距离并且第一个文字的高度小于第二个文字的高度,则将第一个文字沿着指定角度移动到新位置,以避免重叠。 以上是一个简单的CAD重叠文字避让程序及LISP源代码示例,可以根据实际需求进行修改和扩展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值