复制
收藏
提问
全网

解释一下 a = [1 2 2 3 3 3 5 5]; result = []; for i = 1:length(a) found = false; for j = 1:size(result, 1) if result(j, 1) == a(i) result(j, 2) = result(j, 2) + 1; found = true; break; end end if ~found result = [result; a(i) 1]; end end result = sortrows(result, 1); disp(result);

880cab975
刚刚
全网
文档
学术
百科
知识库
时间不限
自动

理解问题解释一下 a = [1 2 2 3 3 3 5 5]; result = []; for i = 1:length(a) found = false; for j = 1:size(result, 1) if result(j, 1) == a(i) result(j, 2) = result(j, 2) + 1; found = true; break; end end if ~found result = [result; a(i) 1]; end end result = sortrows(result, 1); disp(result);

已完成理解解释一下 a = [1 2 2 3 3 3 5 5]; result = []; for i = 1:length(a) found = false; for j = 1:size(result, 1) if result(j, 1) == a(i) result(j, 2) = result(j, 2) + 1; found = true; break; end end if ~found result = [result; a(i) 1]; end end result = sortrows(result, 1); disp(result);

展开阅读网页

更专业一些
转笔记
专业
解释一下 a = [1 2 2 3 3 3 5 5]; result = []; for i = 1:length(a) found = false; for j = 1:size(result, 1) if result(j, 1) == a(i) result(j, 2) = result(j, 2) + 1; found = true; break; end end if ~found result = [result; a(i) 1]; end end result = sortrows(result, 1); disp(result);
不在提醒

更专业内容正在努力生成中
知识树
解释一下 a = [1 2 2 3 3 3 5 5]; result = []; for i = 1:length(a) found = false; for j = 1:size(result, 1) if result(j, 1) == a(i) result(j, 2) = result(j, 2) + 1; found = true; break; end end if ~found result = [result; a(i) 1]; end end result = sortrows(result, 1); disp(result);
这段代码是做什么的?
MATLAB中如何对数组进行排序?
如何使用MATLAB进行循环遍历?

以上内容由AI搜集生成,仅供参考

在线客服