How can i visualize an exact column or row only of a matrix?

1 vue (au cours des 30 derniers jours)
Elias Unk
Elias Unk le 22 Juil 2017
Commenté : Elias Unk le 23 Juil 2017
let's say i have a 50 by 70 matrix and i want all the values of the column number 29, how can i do that.

Réponse acceptée

Image Analyst
Image Analyst le 22 Juil 2017
Extract from .mat file, then call plot. Try this:
storedStructure = load('features.mat');
myMatrix = storedStructure.B; % Extract matrix from the "B" field of the structure.
plot(myMatrix(:,29), 'b-', 'LineWidth', 2);
  2 commentaires
Elias Unk
Elias Unk le 22 Juil 2017
Modifié(e) : Walter Roberson le 22 Juil 2017
i did get the following error:
Error using plot
Invalid first data argument
Image Analyst
Image Analyst le 22 Juil 2017
Please attach your .mat file (third request).

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 22 Juil 2017
plot( YourMatrix(:,29) )
  16 commentaires
Image Analyst
Image Analyst le 23 Juil 2017
Just to expand on this for something you might want to know about some day, if you use
storedStructure = load('features.mat')
it reads in all the variables you stored as fields of storedStructure. So if you have stored A, B, and C, you'd have storedStructure.A, storedStructure.B, and storedStructure.C. Now if you wanted to pull out just one of those (which probably won't make any speed difference unless they were huge), you could ask load() to load just one from the file. For example:
storedStructure = load('features.mat', 'B');
Now storedStructure will have only a B field, not an A and C field. You could also extract the variable into its own B variable, if you want, like this:
B = storedStructure.B;
Just an FYI.
Elias Unk
Elias Unk le 23 Juil 2017
Cheers Walter,very helpful

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by