LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Matlab file in MatlabScript or MathScript

Heloo
 
I need help in for loop which i impliment in Matlab
 
for i=1:16:256  %% where 16  is my jump and 256 is my total iterations
i=out; % out  is some variable
end
 
when i write this Script in MathScript or MatlabScript and try to get the output of  variable "out" it  gives me only the last value which is 244(last value).I  have changed the data type to "DBL". Also tryed to read "out" as array but only last value is comming. while i am interested in values like 1,17,33,49,65. . . How will i get these values as output in one by one iteration.ALso For loop of Labview 8.5 which i am using give the last value.
 
 
Regards
Madd
 
0 Kudos
Message 1 of 4
(7,237 Views)

Hi Madd

When using the Mathscript node, you need to be exact with the datatype you output. In your case, you need to right-click on

the output node and Choose Data Type > 1-d array> I32

as you want to output an one dimensional array of integers. You don't need to do the same for the inputs, LabVIEW figures the datatype automatically

as it is usually a direct wire from a control and not a result of compiled text code.

KostasB

NI UK

 



Message Edited by KostasB on 02-13-2008 03:26 AM
0 Kudos
Message 2 of 4
(7,231 Views)
TNX
 
 WORKS FOR ME
0 Kudos
Message 3 of 4
(7,202 Views)
Hi
i think your m code is wrong ,check once and try
use this one

t=1;
for i=1:16:256  %% where 16  is my jump and 256 is my total iterations
out(t)=i;% out  is some variable
t=t+1;% out=out+1
end


or
sree(1:256/16)=1:16:256

i am not expert in this just i am telling.

all the best
Sreenivasulu.O

0 Kudos
Message 4 of 4
(7,039 Views)