Filter löschen
Filter löschen

Classification of data

1 Ansicht (letzte 30 Tage)
krs.rb1
krs.rb1 am 6 Okt. 2011
Hi,
I am trying to classify all elements of a cell array into 3 different arrays, as shown -
if gt(wrist_flex{j},calib_flex)
x(j)=1;
y(j)=0;
z(j)=0;
elseif gt(wrist_flex{j},calib_flex)
x(j)=0;
y(j)=1;
z(j)=0;
elseif wrist_flex{j} == calib_flex
x(j)=0;
y(j)=0;
z(j)=1;
calib_flex is a constant. wrist_flex is a column cell array which has its first 1000 points equal to calib_flex. After which it varies rapidly across calib_flex. Now when i run the above program, an error message occurs after 1000th iterations -
??? Error using ==> gt
Matrix dimensions must agree.
Error in ==> classify_atmt1 at 26
if gt(wrist_flex{j},calib_flex)
I am not able to comprehend this error. Can anyone please help me understand the error and provide an apt solution?
  5 Kommentare
krs.rb1
krs.rb1 am 7 Okt. 2011
well i converted the cell array to numerical array using str2num...n the code worked....
krs.rb1
krs.rb1 am 7 Okt. 2011
Thanks walter!! :)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by