command prompt result show in left side workspace for some specific command

when i create a matrix result show on command window but when i try to generate diagonal of row matrix the result show on workspace with D=5X5. but i need to show its resultant matrix on command window too.. Here is row Matrix code: m = [3 2 1]; and to find the diagonal matrix, I use D = diag(v);

6 Comments

You forgot to mention how you display the matrix. Some example code would reveal the details.
HI Jan, i edited my question. Please this now
I assume you mean v = [3,2,1], not m? What is the problem then?
v = [3,2,1];
D = diag(v)
ans =
3 0 0
0 2 0
0 0 1
yes but the ans is not showing like this. it shows on workspace as D 3X3 on left bottom window
Is this a question about what shows up in the variable browser, rather than what shows up if you display the array at the command window?
If it is a question about the variable browser, then there was a release not long ago that had a bug affecting the variable browser. I think it was OS-specific, possibly Mac (but I never observed it myself.)
@Ribha: I do not know which window is on the left bottom of your screen. Please try to explain exactly, what you mean. This is more efficient than to hope, that the readers can guess it.

Sign in to comment.

Answers (2)

Your D is probably a cell array for whatever reason. We would need to see your code to say why you ended up with a cell array. Perhaps you did a cellfun with 'uniform' 0

Categories

Asked:

on 24 Mar 2018

Commented:

Jan
on 24 Mar 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!