Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Save inputs from a GUI into 3D matrix (always at the last position)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%prompt command for k number and length
prompt = {'k0:','Length:'};
dlg_title = 'Straight Duct specs';
num_lines = 1;
SDelements = {'0','0'};
Straightduct = inputdlg(prompt,dlg_title,num_lines,SDelements)
%insert values in function
sizeStorageMatrix=size(StorageMatrix); %get size of the storage matrix
dimT=sizeStorageMatrix(1,3); %take the number of matrices
if dimT==1
StorageMatrix(1:2,1:2,1)=straight_duct(str2num(SDelements{1}), str2num(answer{2}), Mach_Frange(1,1))
else
StorageMatrix(1:2,1:2,dimT+1)=straight_duct(str2num(SDelements{1}), str2num(answer{2}), Mach_Frange(1,1))
end
% code
end
This is my code for a GUI to create a 2by2 matrix which i'd like to save in a 3D matrix. This matrix should be saved in the first position of the 3D matrix and when i push the button more it should be saved in that corresponding position in the 3D matrix. I have, however, no idea to do this. Currently i declared my StorageMatrix at the beginning but i get an error when i run: variable storagematrix is not recognized. I've googled, i've run through the matlab help files but i can't seem to find my solution. Any hints?
kind regards,
Youri
2 commentaires
Walter Roberson
le 26 Nov 2013
You do not show any initialization for StorageMatrix, so you would not be able to take size() of it.
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!