当我尝试将代码的输出写入Excel电子表格时,出现以下错误:“未定义变量”结果“或类”results.xlsx“。要理解为什么会出现这种情况无法写入Excel(Matlab)

function [final_matrix] = MCsolutionupdated()

no_iterations = input('No. of iterations?:');

thresh_strain = zeros(1,no_iterations*16);

casechoice =input('Enter 1 for 1st Layup and 2 for 2nd layup:');

J = Nielsennewupdated(casechoice, no_iterations);

thresh_strain = J;

roundedValues = round(thresh_strain/.0001)*0.0001;

myUniqueValues = unique(roundedValues);

i = numel(myUniqueValues);

nelements = hist(thresh_strain(:),myUniqueValues);

for i=1:i

percent(i) = (nelements(1,i)/numel(thresh_strain))*100;

end

final_matrix = [myUniqueValues' percent'];

xlswrite(results.xlsx, final_matrix); % Problem

2014-02-18

Jojo

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐