Error using - Matrix dimensions must agree.Error in mmmmmmmtest1m1m (line 326)a2=aa-a1;
i am surprised why my a2 not calculating my aa value is ok and a1 but the aa and a1 matrices are not equal when i minus them it gave above error ,i spend 10 days on it but this issue is not solving
———————————
Code Hints:-u(hour)=hour; Clothesdrye(hour)=power_pattern(hour,1);a1=find(Clothesdrye);
————————————————
stereo=[1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1];Fan=[0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 1 1];aa=find(stereo);bb=find(Fan);
——————————————-
Index
a2=aa-a1;b2=bb-b1;% len = min([numel(aa) numel(a1)]);-----1
% a1 = aa(1:len) - a1(1:len);-----2
%a1=linspace(0,14,14);%# 14 values spanning the range 0 to 14------3
%a1=[1 8 9 10 11 12 13 14 15 16 17 22 23 24];----4
i have also tried from 1 to 4 but in vain
i am pasting the bit pattern of variables may be helpful for commenters/guiders below.
Error using - Matrix dimensions must agree.Error in WDO_SG_Code_PL_test1m (line 326)a2=aa-a1;>> uu = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24>> power_patternpower_pattern = 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0>> ClothesdryeClothesdrye = 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>> a1a1 = 2 3 4>> aaaa = 1 8 9 10 11 12 13 14 15 16 17 22 23 24>> a1a1 = 2 3 4>> a2Undefined function or variable 'a2'.>> Dish_washeDish_washe = 0 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0>> b2Undefined function or variable 'b2'.>> bbbb = 9 10 11 12 13 14 15 16 17 19 23 24>> b1b1 = 2 3 4 5 6 7 8 10
Best Answer