【发布时间】:2015-08-02 09:57:20
【问题描述】:
我现在正在编写一个 GUI,其中包含一个加载矩阵的按钮:
function Load_Profile_Callback(hObject, eventdata, handles)
% hObject handle to Load_Profile (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[FileName PathName] = uigetfile('*.mat','MATLAB Files');
handles.matrix=importdata([PathName FileName]);
接下来,我想将此矩阵的每一列定义为不同的通道,例如:
handles.Ch01Gr01=handles.matrix.Data(:,2);
handles.Ch01Gr02=handles.matrix.Data(:,3);
handles.Ch01Gr03=handles.matrix.Data(:,4);
handles.Ch01Gr04=handles.matrix.Data(:,5);
handles.Ch01Gr05=handles.matrix.Data(:,6);
handles.Ch01Gr06=handles.matrix.Data(:,7);
handles.Ch01Gr07=handles.matrix.Data(:,8);
如果我不知道这个矩阵中有多少列,
在for loop 中是否有任何选项可以解决这个问题(或者任何其他想法也可以)在这个矩阵维度上运行?
【问题讨论】:
标签: matlab user-interface for-loop matrix handle