How to convert a column vector into an image
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Boni_Pl
am 22 Mai 2019
Kommentiert: Boni_Pl
am 23 Mai 2019
Hello sir
I have an vector of size (258x1). Now I want to convert it into a square matrix (101x101) i.e. in 2D image in matlab.
Please help me.
7 Kommentare
Walter Roberson
am 23 Mai 2019
What data type is the vector, such that it has two values per entry ?
Akzeptierte Antwort
Walter Roberson
am 23 Mai 2019
nrow = 6; ncol = 6;
B = full( sparse(C(:,1), C(:,2), A, nrow, ncol) );
Or
nrow = 6; ncol = 6;
B = accumarray(C, A(:), [nrow ncol]);
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!