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

时间:2025-02-19

% --- 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文档下载到电脑

上一篇:家具设计概述

下一篇:期末补考项目卷

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219