waterfall plot show error

1 view (last 30 days)
Raady
Raady on 15 Apr 2017
Answered: Star Strider on 15 Apr 2017
I have three signals of 4096 time amplitudes in each.
signal1 = channel1(1:4096);
signal2 = channel2(1:4096);
signal3 = channel3(1:4096);
figure(1);
% waterfall(signal1',signal2',signal3');
waterfall(signal1,signal2,signal3);
it says
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
but my signal is of same duration(length). How plot it ? I want to compare the amplitudes of the signals in waterfall plot rather than subplots. Do I need to input any other things for the plot ?

Answers (1)

Star Strider
Star Strider on 15 Apr 2017
Try this:
channel1 = sin(pi*[1:4096]/1024); % Create Data
channel2 = cos(pi*[1:4096]/1024); % Create Data
channel3 = sin(pi*[1:4096]/1024).*cos(pi*[1:4096]/2048); % Create Data
signal1 = channel1(1:4096);
signal2 = channel2(1:4096);
signal3 = channel3(1:4096);
figure(1);
% waterfall(signal1',signal2',signal3');
waterfall([signal1; signal2; signal3]); % Concatenate Vectors Into A Matrix

Community Treasure Hunt

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

Start Hunting!