Why I get 1×0 empty double row vector?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aleksandra Pawlak
am 27 Dez. 2020
Kommentiert: Image Analyst
am 28 Dez. 2020
Hi, I have problem with my code. I don't know why fidx1 is 1x0 empty double row vector?
min(oh1) and max(oh1) results are:
>>min(oh1)
ans = 102.8890
>> max(oh1)
ans = 106.2470
d1=[0 min(oh1) min(oh1)];
e1=[max(oh1) max(oh1) max([oh1 oh2 oh3 oh4 oh5 oh7 oh11 oh13 oh19 oh23 oh25 oh29 oh35 oh37])];
X1=[xq1];
Y1=[100*r1];
lidx1 = find(X1 == max(oh1));
Ylidx1 = Y1(lidx1);
fidx1 = find(X1 == min(oh1));
Yfidx1 = Y1(fidx1);
Akzeptierte Antwort
Ive J
am 27 Dez. 2020
Bearbeitet: Ive J
am 27 Dez. 2020
xq1 (and therefore X1) simply may don't contain min(oh1) since you are discretizing [0, max(oh1)]. What you can do is to find the idx corresponding to the closest value to min_oh1
max_oh1 = 104;
xq1 = 0:104/200:104;
[~, fidx1] = min(abs(xq1 - min(oh1)));
5 Kommentare
Ive J
am 27 Dez. 2020
The first output argument is the minimum value itself, and the second one is it's index.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!