command prompt result show in left side workspace for some specific command
Show older comments
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
Jan
on 24 Mar 2018
You forgot to mention how you display the matrix. Some example code would reveal the details.
Ribha Shakoor
on 24 Mar 2018
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
Ribha Shakoor
on 24 Mar 2018
Walter Roberson
on 24 Mar 2018
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.)
Jan
on 24 Mar 2018
@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.
Answers (2)
Jan
on 24 Mar 2018
X = rand(5, 5);
disp(X)
fprintf('%g %g %g %g %g\n', X.')
Walter Roberson
on 24 Mar 2018
0 votes
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
1 Comment
Ribha Shakoor
on 24 Mar 2018
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!