cancel
Showing results for 
Search instead for 
Did you mean: 

multyplying pervious value of iteration to current value

chakos
Member

multyplying pervious value of iteration to current value

Dear Sir/Madam,

After somedata processing i am getting the output on a single line(i mean a single wire... the data comes out ) in the following format

 

msblsb.....msblsb.....msblsb....etc..i want to multiply the msb with 16 and then add it to the lsb ..and then finally print the result

 

could any one of you be able to help me?

 

 

many thanks in advance

 

have a niece day!

regards,

thomas george

3 REPLIES 3
ttrr
Active Participant

回复: multyplying pervious value of iteration to current value

Hi,

 

I am not fully understand your problem. I guess that you want to multiply the odd elements with 16 and then add them to the even elements. Please try the following script.

a = 1:10
a = a(1:2:end)*16+a(2:2:end)

chakos
Member

Re: 回复: multyplying pervious value of iteration to current value

Dear Sir/Madam,

 

THANKS FOR THE REPLY

What i need is for example if 1 comes out first and  3 comes out next,then the result should be 16*1+3 ,but since i am using the sound card for reading data it doesnt allow me to use timers ,as soon as i use timing control it stops reading 

 

THANKING YOU ONCE AGAIN

 

have a niece day

 

with regards,

thomas george
altenbach
Knight of NI

Re: multyplying pervious value of iteration to current value

Message contains a hyperlink
Probably related to this thread....