Hi, I have a matrix Data(2556,4) , where in the first column represent the space traveled of the vehicle that I'm simulating.
I want to compare, during the simulation, the actual distance traveled of the vehicle S and with the column of the Data(:,1). I tought the best way is to use find() function, so once I know the index I could give the output relative to that index. The code is as follow:
function [ax, k, yaw] = Input_Commands(data, x, y)
s = sqrt( (x-0)^2 + (y-0)^2 ); % Creating the distance s from the starting grid
index = find( (s <= data(:,1)), 1);
ax = data(index,2);
k = data(index,3);
yaw = data(index,4);
The problem is that I get the following error: Data 'ax' is inferred as a variable size matrix, while its properties in the Model Explorer specify its size as inherited or fixed. Please check the 'Variable Size' check box and specify the upper bounds in the size field.
I don't know what to do. I tought the problem is the dimension of the output, so I've tried various solutions but with no success.