MATLAB: How define input data type input when defining a function, for example function y = func(x) how can I define that x is of a specific type, like uint8? Best Answer See doc validateattributes Related SolutionsMATLAB: Selecting different element of a matrix with each function operation Hi JD,You could pass a counter variable i to your function as such:i = 1;while condition i = i+1;endfunction y = func(x, i) global A; y = x - A(i,2);end MATLAB: How can i see if a unit8 var exist or not doc isaA = rand(3,1) ;A = uint8(A) ;if isa(A,'uint8') fprintf('A is uint8\n')else fprintf('A is not uint8\n')end Related QuestionConverting function handle into an operatorMATLAB coder input type definition problemIt is necessary to declare the data type each time I change the valueHow to display a graph after getting user to input in the pop up
Best Answer