|
 |
รบกวนช่วยดู code การเก็บตำแหน่งของตัวอักษร (Matlab) ครับ |
|
 |
|
|
 |
 |
|
สวัสดีทุกท่านครับ
ผมมีปัญหาในการเขียนโปรแกรมมาปรึกษา ผมใช้ matlab เป็นเครื่องมือ
- ปัญหาเรื่องการเก็บตำแหน่งของตัวอักษร
คือผมไม่รู้ว่า ผมจะใช้เงื่อนไขในการเก็บตำแหน่งที่ 2 ยังไงดี
ตาม code นี้นะครับ
tallest = [];
top = [];
center = [];
bottom = [];
gradation = [];
num_tallest = 0;
num_top = 0;
num_center = 0;
num_bottom = 0;
for a = 1:num_test
x(a,1) = b_new(a,2) + b_new(a,4);
top_edge = x(1,1); % ขอบบนตัวพยัญชนะ
bottom_edge = b_new(1,2);%ขอบล่างตัวพยัญชนะ
if bottom_edge >= x(a,1) % ขอบล่างของพยัญชนะมากกว่า ขอบบนของตัวถัดไป
num_top = num_top + 1;
top(num_top,:) = Test(a,:);
gradation(a,1) = 1;
if ตรงนี้เป็น code เก็บตำแหน่งที่สอง แต่ไม่รู้ว่าจะเขียนเงื่อนไขยังไง
else if top_edge <= b_new(a,2) % ขอบบนของพยัญชนะน้อยกว่าขอบล่างของตัวถัดไป
num_bottom = num_bottom + 1;
bottom(num_bottom,:) = Test(a:1);
gradation(a,1) = -1;
else
num_center = num_center + 1;
center(num_center,:) = Test(a,:);
gradation(a,1) = 0;
end
end
end
end
----------------------------------------
มีไฟล์รูปแนบ เพื่อทำความเข้าใจเพื่มเติมครับ


Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2010-12-22 14:49:17 |
By :
pop |
View :
1811 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งง ครับ
|
 |
 |
 |
 |
Date :
2011-06-03 09:44:05 |
By :
แสบจัง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|