当我尝试将代码的输出写入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