How to print symbolic representation of [4^1+1 4^2+1 4^3+1] rather than the actual numerical output?
1 view (last 30 days)
I would like to add a line of texts like "points = 4^1+1 4^2+1 4^3+1" instead of "points = 5 17 65" to chart.
The current content of my code to print "points = 5 17 65" is as following:
for i = 1:3
n = 4^i + 1;
do something with numeric values of n and i (i.e., i = 1, 2, 3)
% Storing "number of points" in vector 'point'
point(i) = n;
disp(['Grid points = ' sprintf('%d ', point)])
Note that I do need the numerical values of n and i (i.e., i = 1, 2, 3 for n = 4^i + 1) to do some computations.
may be appropriate for my intended use, but cannot figure out how to exactly apply it into my for-loop.
Please help me to figure out, any suggestions will be very appreciated!