load function not returning correct array dimension
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
So I want to save() a bunch of array in another file so i can acces it later using load(). When i want to use the array(12x18), i got error message, "error: reshape: can't reshape 1x1 array to 6x3 array". Below is an example of how my code is. How do properly store and access the matrix ? I use a lot of reshape in my code.
a = randi(12,12,18);
save('a.mat','a');
b = load('a.mat','a')
c = reshape(b(1,:),[6,3])
2 Commenti
Johan
il 27 Giu 2022
load puts your saved data in a structure, use b.a to access your data
a = randi(12,12,18);
save('a.mat','a');
b = load('a.mat','a')
c = reshape(b.a(1,:),[6,3])
Risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!