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.

조회 수: 24 (최근 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에서 Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by