Inner matrix dimensions must agree
1 view (last 30 days)
phdcomputer Eng on 10 Dec 2019
I wrote these codes, I splitted the dataset(colon attached) into two parts (data1 and data2) based on the last column(1 or else)and make the columns equal to each others.
for i=1: m-1
and then in for loop I computed the distance value between the data1 and data2 and for computation I defined a function fkumarjohnson (I attached the image of the formula)but I found the error.
function [ fkj ] = fkumarjohnson(p,q )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
the error is:
Error using *
Inner matrix dimensions must agree.
Error in fkumarjohnson (line 4)
Error in myFSmethod (line 62)
The matlab said the inner matrix dimensions of two sides of * must agree but I don't know how to make their dimensions equal.I'll be very gratefull to have your opinions. Thanks
Fabio Freschi on 10 Dec 2019
Note that .^ .* and ./ operators are used for element-wise operation (see also Stephen's comment).
Note also that dot can give apparently unexpected results for complex inputs (see dot help)