手机版

专题软件开发实践报告(4)

发布时间:2021-06-05   来源:未知    
字号:

% --- Executes on button press in pushbutton5.

function pushbutton5_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton5 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) s1=str2double(get(handles.edit2,'String'))

s2=str2double(get(handles.edit3,'String'))

s3=str2double(get(handles.edit4,'String'))

% Set up grid.

h = 1/s1;

x = [h/2:h:1-h/2]';

% Compute matrix K corresponding to convolution with Gaussian kernel.

kernel = (1/sqrt(pi)/s2) * exp(-(x-h/2).^2/s2^2);

K = toeplitz(kernel)*h;

% Set up true solution f_true and data d = K*f_true + error.

f_true = .75*(.1<x&x<.25) + .25*(.3<x&x<.32) + (.5<x&x<1).*sin(2*pi*x).^4;

Kf = K*f_true;

eta = s3/100 * norm(Kf) * randn(s1,1)/sqrt(s1);

d = Kf + eta;

% Display the data.

% Compute an eigendecomposition of K. K is symmetric, so this is % equivalent to an SVD.

[V,svals] = eig(K);

[svals,indx] = sort(-diag(svals)); % Sort -eigenvalues in decreasing order.

svals = -svals; % +eigs are in increasing order. V = V(:,indx); % Corresponding eigenvectors.

%figure(3)

semilogy(svals,'o')

xlabel('index i')

ylabel('\sigma_i')

title('Singular Values of K')

axes(handles.axes1);

专题软件开发实践报告(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
上一篇:家具设计概述
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)