. Create a Matlab script that will load the file finc.mat and create a structure from the appropriate with the following fields: • Company (string) • First_Name (string) • Last_Name (string) • Address (string) • Credit_Card_Number (Integer) • Account_Balance (Real) • Credit_Score (Real) • Transaction (Array) To the right of the field names above are the data type in parentheses. Your code should calculate and display the following: • The descriptive statistics discussed in class of the Credit Scores for each customer. • The Credit Score that is the demarcation of the top 10% of credit scores. • The full name, company, address, account balance, and credit score of the individual with the lowest credit score
function [output]=dataconv(input,src_sig) % % dataconv % % Convolves the data stored in the input matrix with the selected source % signature. % % IMPORTANT: % PRELOAD DATA IN WORKSPACE % % Variable description: % - input = input matrix, preloaded in workspace, call without % hyphens nor .mat extension % - src__sig = selected source signature, already resampled and centered, preloaded in workspace, call without % hyphens nor .mat. If .asc, there is no need to preload in workspace, replace % src_filename=load('filename.asc'), i.e.: output=dataconv(data,load('filename.asc')) % % % EXAMPLE: % test=dataconv(src6p,PGSsig1);;
%% PARAMETERS [nt,ntrc]=size(input);
%% FULL CONVOLUTION
output=zeros(nt,ntrc);
for i=1:ntrc; output(:,i)=conv(input(:,i),src_sig,'same'); end
%% ZERO-OFFSET TRACE DISPLAY input_trc=input(:,1); output_trc=output(:,1); dt=0.002; t=(0:nt-1)*dt;
figure subplot(3,1,1), plot(t,input_trc), grid on, xlim([0.4 2]); title('Green´s function data'), xlabel('Time [s]'); ylabel('Amplitude') subplot(3,1,2), plot(src_sig), grid on; title('Source signature:Resampled and Time-Shifted'),xlabel('Time [s]');ylabel('Amplitude') subplot(3,1,3), plot(t,output_trc), grid on, xlim([0.4 2]); title('Convolution'),xlabel('Time [s]');ylabel('Amplitude')
axes; h = title(['Zero-Offset Trace']); set(gca,'Visible','off'); set(h,'Visible','on','Position',[0.5 1.05 0]);
Get Answers For Free
Most questions answered within 1 hours.