help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading and operate multiples files


From: Andrew Janke
Subject: Re: Loading and operate multiples files
Date: Mon, 25 Mar 2019 18:44:58 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.0



On 3/25/19 4:30 PM, Priscilla wrote:
Hello!

I have been working on a project involving the Picoscope signal
(oscilloscope).
I've made the code below to load the 32 files generated by the Picoscope and
cut those signals in a specific range (1500 - 5000), and it's working.

But now, I need to do some mathematical operations using these files, like
calculate the RMS and the area below the graph of the accumulated
amplitudes. So I made this code:

--------
clear
pkg load signal

#Loading the 32 files
for i = 1:32
     str= strcat(sprintf("pcb 0_%02d.mat", i));
           load(str)

#Cut the signal
Aa = A(1500:5000);
#Aa=Aa-mean(Aa);
step=200;
plot (Aa)
hold on
#Convert to RMS
  Ac=0;
   i=1;

for index=1:step:(5000-step)
   Ab(i)=rms(Aa(index:index+step))-mean(Aa(index:index+step));
#Accumulate the amplitudes
  Ac(i+1)=Ac(i)+Ab(i);
   i=i+1
   end
end
--------

But it is not working...I don't know what is wrong...

Thank you for your help!

Can you give us more details? Are you getting any error messages? What results did you want, and what is actually happening?

http://www.catb.org/~esr/faqs/smart-questions.html

Cheers,
Andrew



reply via email to

[Prev in Thread] Current Thread [Next in Thread]