[繪圖] 新手求助 讀到字串 想畫成圖

作者: kobegreat   2016-05-24 03:47:30
各位大大好
我最近用RS232讀取PIC的值
讀到的是字串 請問要如何能夠讓他畫成點呢?
t=0;
o=0;
while o==0;
hold on
for i=1:50
pause(0.1);
out=fread(SerPIC,10,'uint8');
fprintf('%s',out)
%plot(t,out,'*r')
t=t+0.1;
end
hold off
o=1;
end
用plot得到的圖似乎是字串經過ASCII轉換後的數字
例如應該讀到344.00
可是圖形上的點卻是ASCII轉換後的數字
請問要怎麼做才能使字串例如344.00 畫在plot的圖上呢?
謝謝
作者: name0625 (lawpy)   2016-05-24 07:14:00
str2double

Links booklink

Contact Us: admin [ a t ] ucptt.com