Some of the lines in the code below does not execute, why?
6 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!