How can I resolve the subscripted assignment dimension mismatch error (for the cwt plot)?

2 次查看(过去 30 天)
Hello,
I have an issue with the syntax used for the wavelet plot. The syntax used is:
[cfs(:,i), f(:,i)] = cwt(signal(:,i),fs(:,i)).
I have placed this syntax inside a for loop, where 'i' is the Excel sheet name. However, I am facing an error saying, "Subscripted assignment dimension mismatch." Can you please guide me on how to fix this error? I would appreciate any help you can provide.

采纳的回答

Christopher McCausland
Hi Navid,
Can you please post so information in relation to both your signal and fs variable? Or better yet attach them?
cfs, should probably be a three dimetional array, so:
cfs(:,:,i)
as the cwt will return a two dimentional image if this code is sitting in a for loop. However, until you give us a bit more information this is hard to solve, for example your input signal could be in columns, or may not be.
  12 个评论
Navid
Navid 2023-11-23
Dear Christopher,
I wanted to express my gratitude for the valuable guidance you provided me. This part of the code:
mesh(t(:,i),f(:,i),abs(cfs(:,:,i)).^2)
truthfully gives a deeper understanding of the signal.
However, sometimes, a 2D cwt plot may be more suitable for monitoring specific frequency ranges of a signal.
Thank you for taking the time to share your knowledge with me. Your guidance has been instrumental in helping me improve my work, and I greatly appreciate it.
Best regards,
Navid

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by