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

14 vues (au cours des 30 derniers jours)
Lala0099
Lala0099 le 13 Mar 2019
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

Réponse acceptée

Raghunandan V
Raghunandan V le 14 Mar 2019
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.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by