Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: How do I show variable value in the same line of variable name in the
command window

Replies: 1   Last Post: Nov 30, 2011 9:36 AM

 Messages: [ Previous | Next ]
 mailcwc@gmail.com Posts: 52 Registered: 7/14/05
How do I show variable value in the same line of variable name in the
command window

Posted: Nov 29, 2011 10:25 PM

I want to list the values of some selected variables in a given order.
The most easy way is type each variable one by one.
For examples,
a=1;
b=2;
c=3;
a
b
c

In the command widows, it will show
a =
1
b =
2
c =
3

Is it possible to make it look like
a = 1
b = 2
c = 3

I don't want the values showed in a new line.
the later is more readable for me.
Moreover, this way can show more variables at the same time on the
screen.

The second ideas is to use cell array, but these mean more coding.
A{1,1} = 'a';
A{1,2} = a;
A{2,1} = 'b';
A{2,2} = b;
A{3,1} = 'c';
A{3,2} = c;

A =
'a' [1]
'b' [2]
'c' [3]

Date Subject Author
11/29/11 mailcwc@gmail.com
11/30/11 Steven Lord