合集-matlab

摘要:clc;clear all;close all;N = 1000; % # Number of pointsV = [-10, 0; 0, 10; 10, 0]; % # Triangle vertices, pairs of (x, y)t = sqrt(rand(N, 1));s = rand( 阅读全文
posted @ 2023-04-28 09:18 祥瑞哈哈哈 阅读(181) 评论(0) 推荐(0)
摘要:index=0 阅读全文
posted @ 2023-06-26 19:16 祥瑞哈哈哈 阅读(44) 评论(0) 推荐(0)
摘要:load('convex_subpixel_ptmean_03_SNR_30_sigma_1_Nb_2_Train')wavelength=wavelength/1000;%为啥除1000呢ZeroV = zeros([1 1000])indices = find(GT==1) for i=1:10 阅读全文
posted @ 2023-06-27 16:54 祥瑞哈哈哈 阅读(201) 评论(0) 推荐(0)
摘要:for i=1:1000 ZeroV(i)=acos(dot(E_t,X(1:211,indices(i)))/(norm(E_t)*norm(X(1:211,indices(i)))))*180/piend[n,im]=min(ZeroV);cols=im; %cols 为最小值所在列数pix_c 阅读全文
posted @ 2023-06-28 10:30 祥瑞哈哈哈 阅读(10) 评论(0) 推荐(0)
摘要:clc;clear all;close all;load('convex_subpixel_ptmean_03_SNR_30_sigma_1_Nb_2_Train')wavelength=wavelength/1000;%为啥除1000呢ZeroV = zeros([1 1000])indices 阅读全文
posted @ 2023-06-28 11:22 祥瑞哈哈哈 阅读(7) 评论(0) 推荐(0)
摘要:w=X(1:211,setdiff(1:length(X), indices))w1=X(1:211,1:2)w2=repmat([1,2],211,1)%横向把1和2沿着行方向复制211行,列为2行。w3=w1.*w2%矩阵中每一个格子乘以一个格子w4=w1-w3w3=w1-w2 阅读全文
posted @ 2023-07-02 08:46 祥瑞哈哈哈 阅读(75) 评论(0) 推荐(0)
摘要:zhengshu=x(1:4,1:1000)futou1=x(1:4,1001)futou2=x(1:4,1002)futou3=x(1:4,1003)futou1=futou1/sqrt(sum(futou1.*futou1));fu12=futou1'*futou2futou1mo=sqrt(s 阅读全文
posted @ 2023-07-02 11:39 祥瑞哈哈哈 阅读(145) 评论(0) 推荐(0)
摘要:x1=1y1=3x2=3y2=4x3=2y3=5sum=0x=zeros(1,5050)y=zeros(1,5050)for i=1:1:100 for j=0:1:100-i for k=0:1:100-i-j if i~=100 | j~=100 | k~=100 if i+j+k==100 s 阅读全文
posted @ 2023-07-09 21:10 祥瑞哈哈哈 阅读(115) 评论(0) 推荐(0)
摘要:俩种方法tim1=0.007 tim2=2,用矩阵点乘比循环快。 w=rand(4,1000)t1=clock()w1=w.*ww1=sqrt(sum(w1))t2=clock()tim1=etime(t2,t1);shu=zeros([1 1000])t3=clock()for i=1:1000 阅读全文
posted @ 2023-07-10 15:38 祥瑞哈哈哈 阅读(413) 评论(0) 推荐(0)
摘要:就是隐藏x标签然后用text自己画标签 x=[1,2]y=[389,611]% 直方图bar(x,y);ylabel('像素数');t=text(1,410,num2str(389));t.FontSize = 14t=text(2,631,num2str(611));t.FontSize = 14 阅读全文
posted @ 2023-07-10 18:11 祥瑞哈哈哈 阅读(709) 评论(0) 推荐(0)
摘要:load('convex_subpixel_ptmean_03_SNR_30_sigma_1_Nb_2_Train')load('最终vca提取mat')duanyuan=[E_t,E_minus]wavelength=wavelength/1000;sum=0for i=1:4 sum=sum+a 阅读全文
posted @ 2023-07-11 18:49 祥瑞哈哈哈 阅读(23) 评论(0) 推荐(0)
摘要:如果字符串使用 ‘’ (单引号)括起来,则使用 A = [], A = [A, str] 这种创建矩阵的方式只会导致“字符串连接” 如果字符串使用 “ ”(双引号)括起来,则使用 A = [], A = [A, str] 这种创建矩阵的方式能够创建矩阵 阅读全文
posted @ 2023-07-19 00:13 祥瑞哈哈哈 阅读(465) 评论(0) 推荐(0)
摘要:最终结果为0。 clc;clear all;close all;load('gulfport_wavelength')load('spectra_truth_lab')w1=gulfport_wavelengthw1=round(w1)w2=w1(1:71)w3=w1(2:72)w4=w3-w2in 阅读全文
posted @ 2023-07-19 01:12 祥瑞哈哈哈 阅读(9) 评论(0) 推荐(0)
摘要:A = 1:12;B = reshape(A,[2,2,3])repu=reshape(B,4,3) 第三维顺序没变 阅读全文
posted @ 2023-07-28 13:49 祥瑞哈哈哈 阅读(18) 评论(0) 推荐(0)
摘要:[uniqueData, ~, idx] = unique(positive', 'rows', 'stable'); 而密西西比有重复元素。 因为这里有重复像素即使735个正包数据都去除其依旧有735个正包相同像素。 load('postive_bag')load('all_row')load(' 阅读全文
posted @ 2023-07-28 15:07 祥瑞哈哈哈 阅读(331) 评论(0) 推荐(0)
摘要:行,列,维。 阅读全文
posted @ 2023-07-30 11:43 祥瑞哈哈哈 阅读(25) 评论(0) 推荐(0)
摘要:for i=1:tiqvduanif i==1shimi=[shimi,duan(:,i)]elsetou=duan(:,i)'*shimi mo=shimi.*shimimo=sum(mo,1)%mo=sqrt(mo)k=tou./mok=repmat(k,[h 1]) alltou=k.*shi 阅读全文
posted @ 2023-07-30 11:51 祥瑞哈哈哈 阅读(117) 评论(0) 推荐(0)
摘要:A=[1,2,3,4]B=[1,0,0,1]B=logical(B)C=A(B) 阅读全文
posted @ 2023-08-15 12:21 祥瑞哈哈哈 阅读(18) 评论(0) 推荐(0)
摘要:w=[] for i=1:300 w(i,:)=i end 阅读全文
posted @ 2023-08-17 23:45 祥瑞哈哈哈 阅读(227) 评论(0) 推荐(0)
摘要:w=[1,2,3;4,5,6;7,8,9]w(:,[1,2])=[] 阅读全文
posted @ 2023-10-18 10:47 祥瑞哈哈哈 阅读(70) 评论(0) 推荐(0)
摘要:load('shimi/bujiangweiduan')load('shimi/bujiangweiduan1') load('shimi/bujiangweishimi')load('shimi/bujiangweishimi1')load('allpositive')xishu=positive 阅读全文
posted @ 2023-10-19 16:32 祥瑞哈哈哈 阅读(8) 评论(0) 推荐(0)