Info
此问题已关闭。 请重新打开它进行编辑或回答。
Save inputs from a GUI into 3D matrix (always at the last position)
1 次查看(过去 30 天)
显示 更早的评论
%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 个评论
Walter Roberson
2013-11-26
You do not show any initialization for StorageMatrix, so you would not be able to take size() of it.
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!