Subscript indices must either be real positive integers or logicals.

[signal, Fs, bits_per_sample] = wavread('speech.wav');
T = 1/Fs; % Sampling period in seconds
L = length(signal); % Number of samples in the signal.
t = [0:(L-1)]*T; % Time vector in seconds
shows
Subscript indices must either be real positive integers or logicals.
Error in untitled4 (line 3)
L = length(signal); % Number of samples in the signal.

 Accepted Answer

In windows command type
which length
what did you get?
I guess you get:
length is a variable

More Answers (0)

Categories

Find more on Simulation, Tuning, Visualization, and MIDI in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!