How to compare parts of an Array

조회 수: 3 (최근 30일)
Vitali Walter
Vitali Walter 2017년 6월 6일
Hallo. I am new in programming and try to learn it. I wrote a Programm for analyzing an Hallsensor with an myDAQ. That is the Code:
s = daq.createSession('ni');
addAnalogInputChannel(s,'myDAQ1', 0, 'Voltage');
addAnalogInputChannel(s,'myDAQ1', 1, 'Voltage');
s.Rate = 1000; % Scans pro Sekunde
s.IsContinuous = true; lh = addlistener(s,'DataAvailable',@plotData);
startBackground(s);
s.wait();
end
and the function plotData:
function plotData(src, event)
a = false;
if ~a
A = event.Data;
a = true;
end
%erster Array wird abgespeichert
disp(event.Data)
plot(event.TimeStamps, event.Data);
end
I wants to Programm an Jostick, which is usuing an hallsensor. With the Code and myDAQ I can Display the valtage Graphs for x and y axis. I wntas now to create a function that would Display the Position of the joistick as a dot but dont how to realize it. I thought of to save the first value and compare it with the other values during the session. Not sure how it to do.
Can somebody help me pls?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by