matlab安装问题问题

 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
matlab常见问题小结
下载积分:1000
内容提示:matlab常见问题小结
文档格式:TXT|
浏览次数:6|
上传日期: 12:15:44|
文档星级:
该用户还上传了这些文档
matlab常见问题小结
官方公共微信君,已阅读到文档的结尾了呢~~
MATLAB安装出错问题的解决
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
MATLAB安装出错问题的解决
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口有一个matlab的作图问题?
您好,有一句源代码:plot([center([1 2],1)],[center([1 2],2)],'*','color','k')这个代码的center是2行2列的
我的center是100行3列的,那我怎么改写
plot([center([1 2],1)],[center([1 2],2)],'*','color','k')
这个代码呢?谢谢~center是聚类中心,我想把他们都在一个图中表示~
按投票排序
不清楚你的目的是什么,源代码里画两个点,(x,y)坐标都有;但你的只有一个值,那么默认为y值,x坐标就默认为1,你画那么多次,都在一个竖线上,至于只有一个点,可能是值都一样如果你只是想看矩阵里的值,不在乎横坐标,那么用reshape先转成vector
对于模糊C-均值聚类(Fuzzy C-Means Clustering),MATLAB可以利用fcm函数实现。fcm Data set clustering using fuzzy c-means clustering.
[CENTER, U, OBJ_FCN] = fcm(DATA, N_CLUSTER) finds N_CLUSTER number of
clusters in the data set DATA. DATA is size M-by-N, where M is the number of
data points and N is the number of coordinates for each data point. The
coordinates for each cluster center are returned in the rows of the matrix
CENTER. The membership function matrix U contains the grade of membership of
each DATA point in each cluster. The values 0 and 1 indicate no membership
and full membership respectively. Grades between 0 and 1 indicate that the
data point has partial membership in a cluster. At each iteration, an
objective function is minimized to find the best location for the clusters
and its values are returned in OBJ_FCN.
[CENTER, ...] = fcm(DATA,N_CLUSTER,OPTIONS) specifies a vector of options
for the clustering process:
OPTIONS(1): exponent for the matrix U
(default: 2.0)
OPTIONS(2): maximum number of iterations
(default: 100)
OPTIONS(3): minimum amount of improvement
(default: 1e-5)
OPTIONS(4): info display during iteration
(default: 1)
The clustering process stops when the maximum number of iterations
is reached, or when the objective function improvement between two
consecutive iterations is less than the minimum amount of improvement
specified. Use NaN to select the default value.
data = rand(100,2);
[center,U,obj_fcn] = fcm(data,2);
plot(data(:,1), data(:,2),'o');
maxU = max(U);
% Find the data points with highest grade of membership in cluster 1
index1 = find(U(1,:) == maxU);
% Find the data points with highest grade of membership in cluster 2
index2 = find(U(2,:) == maxU);
line(data(index1,1),data(index1,2),'marker','*','color','g');
line(data(index2,1),data(index2,2),'marker','*','color','r');
% Plot the cluster centers
plot([center([1 2],1)],[center([1 2],2)],'*','color','k')鉴于题主已经得到center矩阵,且size(center)=[100 3],我没怎么接触过聚类这块儿,所以只能照着帮助文档猜测题主提供的数据可能是:每个样本点具有三个变量,总计2233809个样本(观测值);需要对其进行模糊C-均值聚类,聚类中心100个.好在center的列数刚好为3,还可以利用3D图实现数据可视化,为简化聚类过程,我这仅以1000个样本点,3个聚类中心为例。对于题主2233809个样本,100个聚类中心的情形,还请自行扩展。参照Example中的代码,简要将其推广为3维情形:data = rand(1000,3);%缺少原始数据,随机生成1000个样本点(观测值),每样本点有3个变量
[center,U,obj_fcn] = fcm(data,3);
plot3(data(:,1), data(:,2),data(:,3),'.c');
maxU = max(U);
% Find the data points with highest grade of membership in cluster 1
index1 = find(U(1,:) == maxU);
% Find the data points with highest grade of membership in cluster 2
index2 = find(U(2,:) == maxU);
% Find the data points with highest grade of membership in cluster 3
index3 = find(U(3,:) == maxU);
line(data(index1,1),data(index1,2),data(index1,3),'marker','*','color','r');
line(data(index2,1),data(index2,2),data(index2,3),'marker','*','color','g');
line(data(index3,1),data(index3,2),data(index3,3),'marker','*','color','b');
% Plot the cluster centers
plot3([center((1:3),1)],[center((1:3),2)],...
[center((1:3),3)],'.','color','m','MarkerSize',35)
输出结果如下:备注:因为随机生成1000个样本点,聚类结果并不明显,甚至比较杂乱,这个例子仅供参考,还请题主自行甄别~
已有帐号?
无法登录?
社交帐号登录MATLAB学习中的十个常见问题
MATLAB学习中的十个常见问题
ldzbook& 2012.07
本文针对matlab初学者,总结了个人在使用参考教程《信号与系统实验教程·邹海林编》中遇到的一些常见问题,进行了汇总和解决,以作为后学者的参考,希望能有助于提高学习效率。
1Matlabplot
2x(t)=e-0.1tsin(2/3t)x(t)
5subplotfigurehold
Missing MATLAB
& ErrorVectors
must be the same lengths
& ErrorConversion to double from sym is not
&&MATLAB .m文件命名规则
附录二&& 推荐网站
MATLAB学习中的十个常见问题
1Matlabplot
XXx = t0 :
f=cos(t)Picture
2x(t)=e-0.1tsin(2/3t)x(t)
&&&&&&&&&&
x=exp(-0.1*t) .* sin(2/3*t)
.x=exp(-0.1*t) * sin(2/3*t)
ak x=A*a .
DirectoryPicture
tripuls( t , 4
Range: [ -1 , 1 ]
5subplotfigurehold
subplot(line , column , number );& plot (t
linecolumnnumber
figure(n);& plot(t , fn)
offPicture
egy’’(t)
+ 2y’(t) + 100y(t) = 10 sin(2t)
num = [10];
den = [1 2 100];
f = sin(2 * pi * t);
num = [1];
den = [1 2 100];
f = 10 * sin(2 * pi * t);
1subplot(2,1,1)
7-1& Error: Missing MATLAB operator
Eg&& &t1 = -5 : 0.01 :
t2 = -2 : 0.01 :
t = -7 : 0.01 :
8-1ErrorVectors
must be the same lengths
8-1& ErrorVectors
must be the same lengths
Nf1f21N = N1 +
1 1 1 1 1];
conv (f1, f2)
(f);&&&&&&
t;&&&&&&&&&&&&&
t = 0 : 0.01 :
2symslaplaceF,不能直接用plotsubsPicture
9-1ErrorConversion to double from sym is not
t = 0 : 0.01 :
500; f,可直接plot
t = -5 : 0.01
: 5;& f = cos (t);
3laplacesymsErrorFunction
'laplace' is not defined for values of class 'double'
laplace (f)
9-1& ErrorConversion to double from sym is not
formathexlongshortlooserat
[1 4 3 0];
= residue (num, den)
MATLAB .m文件命名规则
M文件的命名有一定规则。当不按规则命名时会使M文件不能正常运行。
规则一:文件名首字符不能是数字或下划线。
以一个简单的绘图程序为例。其M文件被存于F盘中,并以“111”作为文件名。运行后,并没有生成图形,而在命令窗口(Command Window)中返回了数字文件名,ans=111。
而改用“_111”为文件名。命令窗口就出现错误信息。
使用“M111”为文件名。程序就正常运行。
规则二:文件名不能与Matlab的内部函数名相同。
M文件名的命名尽量不要是简单的英文单词,最好是由大小写英文/数字/下划线等组成。原因是简单的单词命名容易与Matlab内部函数同名。
如:以“plot”作为上面示例程序的M文件名。运行后,命令窗口报错。
规则三:M文件名中不能有空格。
若需要用两个或以上单词组合作为文件名,各单词必须直接连接组合(可把每个单词首字母大写以作区分或使用下划线)。
如:以“start plot”作为上面程序M文件名。改用“StartPlot”或者“start_plot”为文件名,程序能正常运行。
另外,对于前人总结的M文件命名规则中“M文件存储路径一定要是英文”,我作了测试。当选取好当前路径(Current Directory),M文件存储路径可以有中文。
纯matlab论坛,内容涉及matlab各个方面的应用,雷达等等。
veryCD是一个资源丰富的网站,各种视频教程、电子版图书、软件等免费下载。
其中,也有部分疑问,希望得到解决,相互交流,相互学习,对本文有任何疑问也可联系作者。联系邮箱:
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

我要回帖

更多关于 用matlab解决实际问题 的文章

 

随机推荐