can anybody please tell me the use of 'val' function in this program.., it is not a valid function,yet the program can't be executed without using this,or by changing the function name.

6 次查看(过去 30 天)
% Load original 1D signal.
clc;
clear all;
close all;
ELEVATED=[]
[fname path]=uigetfile('*.mat');
fname=strcat(path,fname);
load(fname );
z=zeros(100,1);
A=val(1,:)
v1=val(1,:)-val(1,1)
A=v1
A=A'
zc=A(1)
A=[z;A;z]
% s = A(1:1:400);
s = A;
ls = length(s);
figure(1)
plot(s);
title('Actual Signal'),grid on
[c,l]=wavedec(s,4,'db4');
ca1=appcoef(c,l,'db4',1);
ca2=appcoef(c,l,'db4',2);
ca3=appcoef(c,l,'db4',3);
ca4=appcoef(c,l,'db4',4);
figure(2)
plot(c),title('decomposed signal'),grid on
figure(3)
subplot(2,2,1)
plot(ca1),title('1st level reconstructed'),grid on
subplot(2,2,2)
plot(ca2),title('2nd level reconstructed'),grid on
subplot(2,2,3)
plot(ca3),title('3rd level reconstructed'),grid on
subplot(2,2,4)
plot(ca4),title('4th level reconstructed'),grid on

采纳的回答

Kye Taylor
Kye Taylor 2013-3-19
编辑:Kye Taylor 2013-3-19
The lines
[fname path]=uigetfile('*.mat');
fname=strcat(path,fname);
load(fname );
will load a .mat file into the scope of MATLAB environment. That .mat file must contain a variable whose name is val. You likely do not have the .mat file in the right place on your machine, if at all.

更多回答(1 个)

Walter Roberson
Walter Roberson 2013-3-19
In the above, "val" is not a function: it is a variable being loaded from the .mat file.

类别

Help CenterFile Exchange 中查找有关 Signal Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by