Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Save inputs from a GUI into 3D matrix (always at the last position)

1 Ansicht (letzte 30 Tage)
Youri
Youri am 25 Nov. 2013
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
%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 Kommentare
Walter Roberson
Walter Roberson am 26 Nov. 2013
You do not show any initialization for StorageMatrix, so you would not be able to take size() of it.
Youri
Youri am 29 Nov. 2013
i know the code isn't perfect, ive initialized storageMatrix in the openingfnc. I just have no idea on how to access and store Guidata as a 3D matrix. Like i said, i've looked everywhere but not being an experienced programmer i don't have the insight in all the words and ways of the code.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by