find(V,1) returns an index that doesn't match with the plot
1 view (last 30 days)
>> plot (linspace(1,1441-(T_B+1)+1,1441),SL_B_Optml);
>> hold on
>> plot([381 381],[0 1.4],'LineWidth',1)
First of all, the find funciton tells us that my SL_B_Optml array reaches a non-zero value for the first time at the x=381.
The plots written above give this:
We can clearly see that SL_B_Optml array reaches the first non-zero value at x=358.3.
I don't understand what's happening here.
Cris LaPierre on 5 Aug 2022
Find tells you the index value of the elements of SL_B_Optml that meet your criteria. It therefore will be an integer value. However, that is different than an x-value of 381. Here, your x values are linspace(1,1441-(T_B+1)+1,1441).
You should therefore highlight your point doing something like this:
plot([x(381) x(381)],[0 1.4],'LineWidth',1)
We don't have your values, so I can't check if there is anything else wrong.