Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
comparing two matrixes and doing calculations

Subject: comparing two matrixes and doing calculations

From: anil chandy

Date: 19 Jan, 2009 08:25:07

Message: 1 of 2

i have two matrixes for eg
a=[68;34;69;12;30;29;90;38;10;59;40]
 b=[12;3;4;4;12;3;6;7;7;8;12]
here b is formed by masking the last two bits of each element in a ..
here 68, 30, 40 in matrix a corresponds to 12 in b. 34,29 etc corresponds to 3....so i have to find the coorresponding elements in a for the repeating elements in b.. in this eg for 12,3,4,7 etc..

then i have the find the average of the elements (eg average of 68,30,40).. can anyone pls help me out..

Subject: comparing two matrixes and doing calculations

From: anil chandy

Date: 19 Jan, 2009 08:54:03

Message: 2 of 2

clc;
more on;
a=imread('t1s4.bmp');
b=double(a);
[r,c]=size(b);
n=r*c;
z=reshape(a,n,1);
str=dec2bin(z);
str1 = uint8(str - '0');
str1(:,8)=[];
str1(:,7)=[];
p=zeros(n,2);
b1=horzcat(str1,p);
b2=num2str(b1);
b3=bin2dec(b2);

this is the program that i wrote so far..

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us