MATLAB: Trying to display text and variable in a single output line. I was initially trying to use disp then a matrix then fprintf sentence with variabletext output with varyable desired output: The answer is: 800 % I am trying to display this sentence in a single line of output in the command window. thankyou Best Answer name = 'Alice'; age = 12;X = [name,' will be ',num2str(age),' this year.'];disp(X)I FOUND A SAMPLE I WORKED OFF OF thanyou Related SolutionsMATLAB: Disp The final disp(a) is within the scope of the last else. "else" does not terminate until an "end" -- you are not limited to providing only a single statement in an if or elseif or else clause. MATLAB: Calling multiple variables in one line of output n1 = rand;n2 = rand ; fprintf("President Jones, for your %d, Kiloton blast at %d miles\n",n1,n2) Related QuestionCombine fprintf and dispHaving trouble with number displays in matrixFprintf
Best Answer