我的部分工作是测试我的" studentNames"中存储的数据类型。变量
但我相信,因为studentNames
被保存在 MATLAB 无法检测数据类型的单元格内。
我怎么能解决这个问题?
编辑窗口
function [studentCell] =classCellArray(studentNames, studentIDs, studentGrades)
studentCell(1,:) = [ **studentNames{1,:}** studentIDs(1,:) studentGrades(1,:) {mean(studentGrades(1,:))}];
studentCell(2,:) = [ studentNames{2,:} studentIDs(2,:) studentGrades(2,:) {mean(studentGrades(2,:))}];
studentCell(3,:) = [ studentNames{3,:} studentIDs(3,:) studentGrades(3,:) {mean(studentGrades(3,:))}];
studentCell(4,:) = [ studentNames{4,:} studentIDs(4,:) studentGrades(4,:) {mean(studentGrades(4,:))}];
命令窗口
studentCell =
'Ali' 'G10293' [1x3 double] [82.6667]
'Yin' 'G10498' [1x3 double] [ 93]
'Bob' 'G10201' [1x3 double] [56.6667]
'Jim' 'G19532' [1x3 double] [ 100]
EDU>>类(studentNames) 使用subsindex 时出错 功能' subsindex'未定义类' cell'。**
的值