How can I resolve the error message saying, "Error using surf. Data dimensions must agree"?

3 ビュー (過去 30 日間)
Navid
Navid 2024 年 1 月 20 日
編集済み: Walter Roberson 2024 年 1 月 20 日
Hello,
I am encountering an issue with the Morse wavelet while running the following code. I received an error message stating,
"Error using surf. Data dimensions must agree,"
However, the code runs for the "bior6.8" wavelet without issues. I would be grateful if you could assist me in resolving this error. Thank you for taking the time to review my request.
Best regards,
Navid
Code:
wname = 'bior6.8'; %type of wavelet
N = length(signal);
fs = 200
tv = (0:N-1)/fs; %fs = sampling rate
scales = 1:200;
C = cwt(signal,scales,wname);
[T,S] = meshgrid(tv,scales);
% Plot the CWT coefficients with time and scales
figure;
surf(T,S,abs(C),'EdgeColor','none')
view(0,90); % Set the view to 2D
xlabel('Time (sec)');
ylabel('Scale');
  2 件のコメント
Navid
Navid 2024 年 1 月 20 日
Please review the following link:
The information presented is crucial to our ongoing discussion, and I believe it will be highly relevant for our purposes. Your attention to this matter is greatly appreciated. Thank you.
Image Analyst
Image Analyst 2024 年 1 月 20 日
Does numel(T), numel(S), and numel(C) all give the same number of elements? If so, is C a vector? Maybe it wants them all to be vectors or all matrices of the same size.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeContinuous Wavelet Transforms についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by