LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

how we can process this matlab code with labview .

when i have processed this code with math script i found one errror . how we can elliminate this error.
only i want to proces this dc shift function by labview.
i am forwarding the codes which are
 
 
function [Sig]= dcshift(Signal)
Signal=load('C:\MATLAB6p5\work\EEG programs\mat files-good  4 sec epochs\Dayanand_36.mat');
n=length(Signal);
avg=0;
for i=1:n
    avg=avg+Signal(i).dayanand00_36_00_39;
end
avg=avg/n;
Sig=Signal(i).dayanand00_36_00_39-avg;
hold on
plot(Sig-avg)
plot(Sig)
%plot(avg)
hold off
axis([300 400 -inf inf])
 
 
 
 
 
thanks & regards
 
rachana
0 Kudos
Message 1 of 2
(6,444 Views)
Hello rachana,

The "Signal" variable in your function is a structure array.  Unfortunately, LabVIEW MathScript does not have support for structures at this time.  One solution to work around this error is to restructure your save file.  It looks like you are only using one field in the structure: dayanand00_36_00_39.  Instead of saving a structure array, you could save an array of these points.  Then you can load this array and work with it in LabVIEW MathScript.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 2
(6,436 Views)