Hi everyone, basically this is the coding that has been given to me.
%% setting up some variables
ws = round(620*100); % as ws is input in cycles, and better to have it in samples
[m,n] = size(@stateS3FastAnkleAngle);
state = [@stateS3FastAnkleAngle;NaN*ones(ws,n)]; % we extend the state space with NaN, so that we don't run into problems later
divergence = NaN*ones(m*n_neighbours,ws); % set up the output divergence matrix
but after I run the coding, it states that too many output argument. Can someone help me? I'm still newbie in Matlab and wanted to learn more.

5 件のコメント

Peng Li
Peng Li 2020 年 4 月 3 日
what does this stateS3FastAnkleAngle return, or what are your m and n?
redroses
redroses 2020 年 4 月 3 日
Hi Peng Li,
stateS3FastAnkleAngle is actually function from another m.file...I want to call that function in this m.file.
Ameer Hamza
Ameer Hamza 2020 年 4 月 3 日
There are syntax issues in your code, and you cannot have function handles numeric data in the same array.
state = [@stateS3FastAnkleAngle;NaN*ones(ws,n)];
Can you explain what problem you are trying to solve?
redroses
redroses 2020 年 4 月 3 日
Hi Sir,
First of all this is the actual coding:
%% setting up some variables
ws = round(ws*fs);
[m,n] = size(state);
state = [state;NaN*ones(ws,n)];
for (state) variable, I want to call that function from another m.file. In the third row of my coding, I want to extend the state space with NaN.
Based on your statement above, that's mean I cannot use @ in the same array. am I right?
Stephen23
Stephen23 2020 年 4 月 5 日
This is very odd:
NaN*ones(ws,n)
Much better:
nan(ws,n)

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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 3 日

0 投票

Yes, you cannot function handle @ in the same array as numbers. You need to call the function with an input value like this
ws = round(ws*fs);
[m,n] = size(stateS3FastAnkleAngle(input_value));
state = [stateS3FastAnkleAngle(input_value);NaN*ones(ws,n)];
here input_value is the input to function stateS3FastAnkleAngle.

2 件のコメント

redroses
redroses 2020 年 4 月 5 日
thanks so much! got it yeay
Ameer Hamza
Ameer Hamza 2020 年 4 月 5 日
Glad to be of help.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

リリース

R2019a

質問済み:

2020 年 4 月 3 日

コメント済み:

2020 年 4 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by