I have defined [Sensitivity], but I get an error message.
Show older comments
clear all
close all
d = daq("ni")
ch = addinput(d, "Dev1", "ai1", "Accelerometer");
d.Rate = 44100;
ch.Sensitivity = 9.80665;
data = read(d, seconds(20));
plot(data.Time, data.Dev1_ai1);
ylabel("Acceleration (Gravities)");
%this code position is left up
Acceleration in App Designer on MATLAB as shown in the upper left of the attached photo, as shown in the lower left.
Reference URL
I want to graph it using [MeasurementTypes] as [Accelerometer].
The error message (in the attached photo on the upper right) says to define "Sensitivity", so I would like to use the code view of the reference URL: after the line break of addinput(~); at line 630, I would like to use the following line to define "Sensitivity".
switch measurementType
case 'Accelerometer'
Channels(1).Sensitivity=9.80665;
end
I have included the following
However, the
The variable 'Channels' is a structure, and the variable has been modified, but the value does not seem to be used. It is marked as.
Can anyone represent acceleration using App Designer?
I am using Matlab 2021b, NI_USB4431 and accelerometers in my environment.
I'm Japanese, so if you could use a simple syntax, that would be great...
Translated with www.DeepL.com/Translator (free version)

Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!