how to print variables in command window with message
6 views (last 30 days)
Show older comments
Triveni
on 13 Dec 2015
Answered: Walter Roberson
on 13 Dec 2015
A=[1, 3,4]
I want to print size of A is length(A) and A is print(A , length(A))
Accepted Answer
Walter Roberson
on 13 Dec 2015
I had to make some guesses about exactly what you want output.
varname = 'A';
varlength = length(A);
fprintf('size of %s is %d\n', varname, varlength);
fprintf('%s is', varname);
fprintf(' %g', [A(:); varlength]);
fprintf('\n');
0 Comments
More Answers (0)
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!