Some of the lines in the code below does not execute, why?

10 ビュー (過去 30 日間)
Lala0099
Lala0099 2019 年 3 月 13 日
回答済み: Raghunandan V 2019 年 3 月 14 日
Hi everyone,
The code example I included in the link was created to help my previous question in Mathwork , by Image Analyst.
There is a few lines in the code that does not execute.
[maxDeviation, timePoint3] = max(meanDeviationFromMean);
and as a result of this, some other lines dont execute either.
I tried to fin the problem. When I called certain values from the function: signal, meanSignal, sdSignal
by the line:
meanSignal = FindTimePoint2(xa);
sdSignal = FindTimePoint2(xa);
signal=FindTimePoint2(xa);
I got the same values for all of them,104,which makes me believe that there is something wrong with the input to the function?
I really dont understand why the signal ( which is the input to the function) comes out as a number. I thought it would be a coloumn ( and array of the content of one coloumn of a table).
I believe that is where the problem might originate, but i cannot seem to fix it. I am very unsure about the nature of the problem too...
I am a beginner. I would appreciate any help

採用された回答

Raghunandan V
Raghunandan V 2019 年 3 月 14 日
Hi,
I went through the code. Technically code has no problems with the code. Everyline is being executed. You can try it by having breakpoints. (As you are a beginner, you need to learn about break points. Its a great tool to debug any code). As far as the output 104 is considered, please look at the function FindTimePoint2. The returned value is
timePoint2 = find(meanDeviationFromMean(1:timePoint3) <= 6*sdSignal, 1, 'last');
This output is a single element for this particular data. hence you get single valur output from this function.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by