Filter löschen
Filter löschen

How do I get my program to c or downloaded to arduino?

1 Ansicht (letzte 30 Tage)
Kay Wonderley
Kay Wonderley am 25 Mär. 2018
Bearbeitet: Walter Roberson am 28 Mär. 2018
I have a .m file which I need to convert to C. arduino in fact.When I use the Matlab coder app. it prompts me for a function. it won't accept my .m file. So how do I get my program to c or downloaded to arduino

Akzeptierte Antwort

Abhishek Ballaney
Abhishek Ballaney am 28 Mär. 2018
Convert your script to a function

Weitere Antworten (1)

Kay Wonderley
Kay Wonderley am 28 Mär. 2018
Bearbeitet: Walter Roberson am 28 Mär. 2018
Hi Abhishek,
Thanks for your reply, and you are right.
hi Anish ,
Thank you for answering. you are right.
my problem is:
being new to program and trying to work out the inputs and outputs of this code:
here is part of it. it is a filtered X-LMS for active noise cancellation.
Fs = 2000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 4000; % Length of signal
t = (0:L-1)*T; %time
A=[16 18 28 33 38 41 59 43 40 58]; %input Amplitudes of the frequencies 10 10 of them
forigin=[25 31.5 40 50 63 80 100 125 160 200]; % input frequencies in Hz of the matrix
S=zeros(1,length(t)); % row matrix initially populated with zeros 1 x 4000 secondary path
V=zeros(1,L); % row matrix of zeros from 1 to 4000primary path from 1 to 4000
for k=1:length(A) %
S = S+10^(A(k)/20)*sin(2*pi*forigin(k)*t); % secondary path calculated via for loop output sine wave?
V=V+sqrt(10^(A(k)/20))*sin(2*pi*forigin(k)*t);% primary path calculated via for loop output sine wave
end
I think the input is (a)
an the output is S and V

Kategorien

Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by