Plotting a 2-d matrix v/s a vector
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want a 3-d plot such that the rows and columns of the matrix are depicted on two separate axes and the third axis shows values of the vector. How can this be done?
plot(Y,sigmab);
Currently I am using this command, in which sigmab is a matrix and Y is a vector. It plots every row with Y and thus gives me multiple graphs equal to the no. of columns on the same plot. But if I want to know that a particular graph belongs to which column no., I cannot find out.(I don't even know if it is plotting eevry row or column with Y, its just a guess.)
I thought of creating a 3-d matrix, and combining Y and sigmab together in it, but I'm not sure which command would exactly give what I want, as I want the axes to be numbered according to the range of values of the matrix, also, it would take up a lot of space, so I'm kind of avoiding it unless absolutely necessary.
0 Kommentare
Antworten (1)
Walter Roberson
am 27 Jun. 2012
col_labels = cellstr( num2str((1:size(sigmab,2)).', 'Column %d') );
legend( col_labels{:} );
3 Kommentare
Walter Roberson
am 28 Jun. 2012
You want, "the third axis shows values of the vector". Which vector is that? Do you have a vector of values for each (row,column) position? If you do then that requires either a 4D plot or else a volume plot. 4D plots are difficult to create on what is really a 2D coordinate system. Volume plots are difficult to see "into".
If you have one value for each (row,column) position, then perhaps surf() is appropriate, perhaps in conjunction with turning a data cursor on so that you can determine the coordinates and value of a location by pointing to it.
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!