MATLAB: Access position of a number access number Is it possible to access the position of a number if it isn't a vector? for example if true A=12345 if (A(firstNumber)==1)disp('Text')end Best Answer You can convert the number to string using num2str and access the number.A = 12345 ;B = num2str(A) ;B(1) Related SolutionsMATLAB: Easy question comparing strings You can just ISNAN instead: str = input('Please enter a number \n\n','s'); X = str2double(str); if isnan(X) disp('That was not a valid number'); else disp('Here is your number') disp(X) end MATLAB: Add specific numbers to a plot Read about the function text. Related QuestionIs there a format in MATLAB to display numbers such that commas are automatically inserted into the displayI need to rewrite numbers of variable to vector.Do I get the error ‘Missing operator, comma, semicolon, or white space.’ when I do not have a space between elements of the matrix
Best Answer