mscohere function with two cell arrays

1 回表示 (過去 30 日間)
Felicia DE CAPUA
Felicia DE CAPUA 2023 年 1 月 12 日
回答済み: Aditya Jha 2023 年 1 月 16 日
Hi everyone,
I'm using mscohere functiom with two cell arrays 64x1. When I obtain the output, I obtain a cell array 64x1. After, I converted the cell array in matrix array with cell2mat ed obtain a matrix 33554496x64. What is the problem?
Thank to everyone
  2 件のコメント
Jiri Hajek
Jiri Hajek 2023 年 1 月 13 日
Hi, this would be pure guesswork, without a data sample.
Bjorn Gustavsson
Bjorn Gustavsson 2023 年 1 月 13 日
編集済み: Bjorn Gustavsson 2023 年 1 月 13 日
mscohere does not accept cell-arrays as input:
xCell1 = {randn(64,1)};
xCell2 = {randn(64,1)};
whos xCell1 xCell2
Name Size Bytes Class Attributes
xCell1 1x1 616 cell
xCell2 1x1 616 cell
mscohere(xCell1,xCell2)
Error using pwelch
Expected x to be one of these types:
single, double
Instead its type was cell.
Error in welchparse>parse_inputs (line 80)
validateattributes(y1,{'single','double'}, {'finite','nonnan'},'pwelch','x')
Error in welchparse (line 31)
parse_inputs(x1,esttype,varargin{:});
Error in welch (line 43)
welchparse(x,esttype,varargin{:});
Error in mscohere (line 161)
[varargout{1:nargout}] = welch({x,y},esttype,inputArgs{:});
80 validateattributes(y1,{'single','double'}, {'finite','nonnan'},'pwelch','x')
So clearly you call mscohere with data in some other format.
If you are new to matlab I might be so bold as to suggest that you walk through the on-ramp material/course/presentations. It is designed to get people up and running as fast and efficiently as possible.

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

回答 (1 件)

Aditya Jha
Aditya Jha 2023 年 1 月 16 日
Hi!
mscohere does not accept cell-arrays as input.
For more details about valid data types to mscohere, please refer to the following documentation: https://www.mathworks.com/help/signal/ref/mscohere.html

カテゴリ

Help Center および File ExchangeExplore and Edit Images with Image Viewer App についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by