フィルターのクリア

()-indexing must appear last in an index expression.

1 回表示 (過去 30 日間)
Laura Barroso
Laura Barroso 2018 年 3 月 19 日
編集済み: James Tursa 2018 年 3 月 19 日
Do you know what is wrong with my indexing below? In my previous computer, I didn't have any problems. Thank you.
function [ wsys, wque ] = dowelch(cli, lambda, rep, win)
if nargin < 1 cli=3000; end
if nargin < 2 lambda = 90; end
if nargin < 3 rep=10; end
if nargin < 4 win=500; end
[ tsys, tque ] = mm1rep(cli, lambda, rep);
wsys = welch( mean(tsys)(:), win );
wque = welch( mean(tque)(:), win );
plot (wsys);

回答 (1 件)

James Tursa
James Tursa 2018 年 3 月 19 日
編集済み: James Tursa 2018 年 3 月 19 日
You can't daisy-chain indexing onto the end of a function return variable. E.g., this
wsys = welch( mean(tsys)(:), win );
wque = welch( mean(tque)(:), win );
needs to be something like this:
wsys = welch( reshape(mean(tsys),[],1), win );
wque = welch( reshape(mean(tque),[],1), win );
or this:
temp = mean(tsys);
wsys = welch( temp(:), win );
temp = mean(tque);
wque = welch( temp(:), win );

カテゴリ

Help Center および File ExchangeMath Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by