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